/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('ga', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddEntriesToAclRequest {
  aclEntries?: [ 
    {
      entry?: string(name='Entry', description='The IP address (192.168.XX.XX) or CIDR block (10.0.XX.XX/24) that you want to add to the ACL. You can add a maximum of 50 entries at a time.

>  This parameter is required.', example='10.0.XX.XX/24'),
      entryDescription?: string(name='EntryDescription', description='The description of the entry.

You can add the descriptions of up to 50 entries in each request.

The description must be 1 to 256 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).', example='test-entry'),
    }
  ](name='AclEntries', description='The entries (IP addresses or CIDR blocks) that you want to add to the ACL.

You can delete a maximum of 50 entries at a time.

This parameter is required.'),
  aclId?: string(name='AclId', description='The ACL ID.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model AddEntriesToAclResponseBody = {
  aclId?: string(name='AclId', description='The ACL ID.', example='nacl-hp34s2h0xx1ht4nwo****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model AddEntriesToAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEntriesToAclResponseBody(name='body'),
}

/**
 * @summary Adds IP addresses or CIDR blocks to an access control list (ACL). You can add IP addresses or CIDR blocks to an ACL and configure a whitelist or blacklist to allow or deny requests from clients.
 *
 * @description *   **AddEntriesToAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) or [ListAcls](https://help.aliyun.com/document_detail/258291.html) operation to query the status of the ACL to which you want to add IP entries.
 *     *   If the ACL is in the **configuring** state, it indicates that IP entries are added to the ACL. In this case, you can perform only query operations.
 *     *   If the ACL is in the **active** state, it indicates that IP entries are added to the ACL.
 * *   The **AddEntriesToAcl** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request AddEntriesToAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddEntriesToAclResponse
 */
async function addEntriesToAclWithOptions(request: AddEntriesToAclRequest, runtime: Util.RuntimeOptions): AddEntriesToAclResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclEntries)) {
    query['AclEntries'] = request.aclEntries;
  }
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddEntriesToAcl',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds IP addresses or CIDR blocks to an access control list (ACL). You can add IP addresses or CIDR blocks to an ACL and configure a whitelist or blacklist to allow or deny requests from clients.
 *
 * @description *   **AddEntriesToAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) or [ListAcls](https://help.aliyun.com/document_detail/258291.html) operation to query the status of the ACL to which you want to add IP entries.
 *     *   If the ACL is in the **configuring** state, it indicates that IP entries are added to the ACL. In this case, you can perform only query operations.
 *     *   If the ACL is in the **active** state, it indicates that IP entries are added to the ACL.
 * *   The **AddEntriesToAcl** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request AddEntriesToAclRequest
 * @return AddEntriesToAclResponse
 */
async function addEntriesToAcl(request: AddEntriesToAclRequest): AddEntriesToAclResponse {
  var runtime = new Util.RuntimeOptions{};
  return addEntriesToAclWithOptions(request, runtime);
}

model AssociateAclsWithListenerRequest {
  aclIds?: [ string ](name='AclIds', description='The ID of the ACL. You can associate up to two ACL IDs.

This parameter is required.'),
  aclType?: string(name='AclType', description='The type of the ACL. Valid values:

*   **white**: Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. Whitelists are suitable for scenarios in which you want to allow access from specific IP addresses to an application. If a whitelist is improperly configured, risks may arise. After a whitelist is configured for a listener, only requests from the IP addresses that are added to the whitelist are distributed by the listener. If a whitelist is enabled but no IP address is added to the whitelist, the listener forwards all requests.
*   **black**: All requests from the IP addresses or CIDR blocks in the ACL are rejected. Blacklists are suitable for scenarios in which you want to deny access from specific IP addresses to an application. If the blacklist is enabled but no IP addresses are added to the ACL, the listener forwards all requests.

This parameter is required.', example='White'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='02fb3da4****'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to only precheck the request. Default value: false. Valid values:

*   **true**: prechecks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false**: sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID.

Only intelligent routing listeners support ACLs.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model AssociateAclsWithListenerResponseBody = {
  aclIds?: [ string ](name='AclIds', description='The ID of the ACL.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model AssociateAclsWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateAclsWithListenerResponseBody(name='body'),
}

/**
 * @summary Associates access control lists (ACLs) with a listener.
 *
 * @description ## Description
 * *   **AssociateAclsWithListener** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the state of the listener with which you attempt to associate an ACL.
 *     *   If the listener is in the **updating** state, it indicates that the ACL is being associated. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that the ACL is associated.
 * *   The **AssociateAclsWithListener** operation cannot be called repeatedly for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request AssociateAclsWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateAclsWithListenerResponse
 */
async function associateAclsWithListenerWithOptions(request: AssociateAclsWithListenerRequest, runtime: Util.RuntimeOptions): AssociateAclsWithListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!Util.isUnset(request.aclType)) {
    query['AclType'] = request.aclType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateAclsWithListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates access control lists (ACLs) with a listener.
 *
 * @description ## Description
 * *   **AssociateAclsWithListener** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the state of the listener with which you attempt to associate an ACL.
 *     *   If the listener is in the **updating** state, it indicates that the ACL is being associated. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that the ACL is associated.
 * *   The **AssociateAclsWithListener** operation cannot be called repeatedly for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request AssociateAclsWithListenerRequest
 * @return AssociateAclsWithListenerResponse
 */
async function associateAclsWithListener(request: AssociateAclsWithListenerRequest): AssociateAclsWithListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateAclsWithListenerWithOptions(request, runtime);
}

model AssociateAdditionalCertificatesWithListenerRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  certificates?: [ 
    {
      domain?: string(name='Domain', description='The domain name that is specified by the certificate. You can associate each domain name with only one additional certificate.

You can specify up to 10 domain names in each request.

This parameter is required.', example='example.com'),
      id?: string(name='Id', description='The ID of the certificate. Only server certificates are supported.

You can specify up to 10 certificate IDs in each request.

This parameter is required.', example='6092**-cn-hangzhou'),
    }
  ](name='Certificates', description='The additional certificates.

You can specify up to 10 certificates in each request.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  listenerId?: string(name='ListenerId', description='The listener ID. Only HTTPS listeners are supported.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model AssociateAdditionalCertificatesWithListenerResponseBody = {
  listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model AssociateAdditionalCertificatesWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateAdditionalCertificatesWithListenerResponseBody(name='body'),
}

/**
 * @summary Associates additional certificates with an HTTPS listener. You can associate multiple certificates with an HTTPS listener and configure virtual endpoint groups and forwarding rules to accelerate access to multiple HTTPS-capable domain names.
 *
 * @description *   Only HTTPS listeners can be associated with additional certificates.
 * *   **AssociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of the listener with which you want to associate an additional certificate.
 *     *   If the listener is in the **updating** state, it indicates that the additional certificate is being associated. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that the additional certificate is associated.
 * *   The **AssociateAdditionalCertificatesWithListener** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request AssociateAdditionalCertificatesWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateAdditionalCertificatesWithListenerResponse
 */
async function associateAdditionalCertificatesWithListenerWithOptions(request: AssociateAdditionalCertificatesWithListenerRequest, runtime: Util.RuntimeOptions): AssociateAdditionalCertificatesWithListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateAdditionalCertificatesWithListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates additional certificates with an HTTPS listener. You can associate multiple certificates with an HTTPS listener and configure virtual endpoint groups and forwarding rules to accelerate access to multiple HTTPS-capable domain names.
 *
 * @description *   Only HTTPS listeners can be associated with additional certificates.
 * *   **AssociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of the listener with which you want to associate an additional certificate.
 *     *   If the listener is in the **updating** state, it indicates that the additional certificate is being associated. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that the additional certificate is associated.
 * *   The **AssociateAdditionalCertificatesWithListener** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request AssociateAdditionalCertificatesWithListenerRequest
 * @return AssociateAdditionalCertificatesWithListenerResponse
 */
async function associateAdditionalCertificatesWithListener(request: AssociateAdditionalCertificatesWithListenerRequest): AssociateAdditionalCertificatesWithListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateAdditionalCertificatesWithListenerWithOptions(request, runtime);
}

model AttachDdosToAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance with which the Anti-DDoS Pro/Premium instance is associated.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  ddosId?: string(name='DdosId', description='The ID of the Anti-DDoS Pro/Premium instance to be associated with the GA instance.

This parameter is required.', example='ddoscoo-cn-zz11vq7j****'),
  ddosRegionId?: string(name='DdosRegionId', description='The region where the Anti-DDoS Pro/Premium instance is deployed. Valid values:

*   **cn-hangzhou**: regions in the Chinese mainland
*   **ap-southeast-1**: regions outside the Chinese mainland

This parameter is required.', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model AttachDdosToAcceleratorResponseBody = {
  ddosId?: string(name='DdosId', description='The ID of the Anti-DDoS Pro/Premium instance that is associated with the GA instance.', example='ddoscoo-cn-zz11vq7j****'),
  gaId?: string(name='GaId', description='The ID of the GA instance that is associated with the Anti-DDoS Pro/Premium instance.', example='ga-bp1odcab8tmno0hdq****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6'),
}

model AttachDdosToAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachDdosToAcceleratorResponseBody(name='body'),
}

/**
 * @summary Associates an Anti-DDoS Pro or Anti-DDoS Premium instance with a Global Accelerator (GA) instance.
 *
 * @description When you call this operation, take note of the following items:
 * *   **AttachDdosToAccelerator** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) or [ListAccelerators](https://help.aliyun.com/document_detail/153236.html) operation to query the status of the GA instance.
 *     *   If the GA instance is in the **configuring** state, the Anti-DDoS Pro or Anti-DDoS Premium instance is being associated with the GA instance. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the Anti-DDoS Pro or Anti-DDoS Premium instance is associated with the GA instance.
 * *   You cannot repeatedly call the **AttachDdosToAccelerator** operation for the same GA instance within a specific period of time.
 *
 * @param request AttachDdosToAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachDdosToAcceleratorResponse
 */
async function attachDdosToAcceleratorWithOptions(request: AttachDdosToAcceleratorRequest, runtime: Util.RuntimeOptions): AttachDdosToAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.ddosId)) {
    query['DdosId'] = request.ddosId;
  }
  if (!Util.isUnset(request.ddosRegionId)) {
    query['DdosRegionId'] = request.ddosRegionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachDdosToAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates an Anti-DDoS Pro or Anti-DDoS Premium instance with a Global Accelerator (GA) instance.
 *
 * @description When you call this operation, take note of the following items:
 * *   **AttachDdosToAccelerator** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) or [ListAccelerators](https://help.aliyun.com/document_detail/153236.html) operation to query the status of the GA instance.
 *     *   If the GA instance is in the **configuring** state, the Anti-DDoS Pro or Anti-DDoS Premium instance is being associated with the GA instance. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the Anti-DDoS Pro or Anti-DDoS Premium instance is associated with the GA instance.
 * *   You cannot repeatedly call the **AttachDdosToAccelerator** operation for the same GA instance within a specific period of time.
 *
 * @param request AttachDdosToAcceleratorRequest
 * @return AttachDdosToAcceleratorResponse
 */
async function attachDdosToAccelerator(request: AttachDdosToAcceleratorRequest): AttachDdosToAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachDdosToAcceleratorWithOptions(request, runtime);
}

model AttachLogStoreToEndpointGroupRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** for each API request may be different.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of the endpoint groups.

This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  slsLogStoreName?: string(name='SlsLogStoreName', description='The name of the Logstore.

This parameter is required.', example='lsn-01'),
  slsProjectName?: string(name='SlsProjectName', description='The name of the Log Service project.

This parameter is required.', example='pn-01'),
  slsRegionId?: string(name='SlsRegionId', description='The region ID of the Log Service project.

This parameter is required.', example='cn-hangzhou'),
}

model AttachLogStoreToEndpointGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model AttachLogStoreToEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachLogStoreToEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Associates a Log Service Logstore with an endpoint group.
 *
 * @description *   **AttachLogStoreToEndpointGroup** is an asynchronous operation. After you send a request, the system returns a request ID, but this operation is still being performed in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that a Logstore is being associated with the group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that a Logstore is associated with the group.
 * *   The **AttachLogStoreToEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request AttachLogStoreToEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachLogStoreToEndpointGroupResponse
 */
async function attachLogStoreToEndpointGroupWithOptions(request: AttachLogStoreToEndpointGroupRequest, runtime: Util.RuntimeOptions): AttachLogStoreToEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupIds)) {
    query['EndpointGroupIds'] = request.endpointGroupIds;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.slsLogStoreName)) {
    query['SlsLogStoreName'] = request.slsLogStoreName;
  }
  if (!Util.isUnset(request.slsProjectName)) {
    query['SlsProjectName'] = request.slsProjectName;
  }
  if (!Util.isUnset(request.slsRegionId)) {
    query['SlsRegionId'] = request.slsRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachLogStoreToEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a Log Service Logstore with an endpoint group.
 *
 * @description *   **AttachLogStoreToEndpointGroup** is an asynchronous operation. After you send a request, the system returns a request ID, but this operation is still being performed in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that a Logstore is being associated with the group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that a Logstore is associated with the group.
 * *   The **AttachLogStoreToEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request AttachLogStoreToEndpointGroupRequest
 * @return AttachLogStoreToEndpointGroupResponse
 */
async function attachLogStoreToEndpointGroup(request: AttachLogStoreToEndpointGroupRequest): AttachLogStoreToEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachLogStoreToEndpointGroupWithOptions(request, runtime);
}

model BandwidthPackageAddAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1qe94o52ot4pkfn****'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The bandwidth plan ID.

This parameter is required.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model BandwidthPackageAddAcceleratorResponseBody = {
  accelerators?: [ string ](name='Accelerators', description='The GA instance IDs.'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The bandwidth plan ID.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  requestId?: string(name='RequestId', description='The request ID.', example='B7770CB9-9745-4FE5-9EDA-D14B01A12A50'),
}

model BandwidthPackageAddAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BandwidthPackageAddAcceleratorResponseBody(name='body'),
}

/**
 * @summary Associates a bandwidth plan with a Global Accelerator (GA) instance.
 *
 * @description *   **BandwidthPackageAddAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the bandwidth plan that you want to associate.
 *     *   If the bandwidth plan is in the **binding** state, it indicates that the bandwidth plan is being associated. In this case, you can perform only query operations.
 *     *   If the bandwidth plan is in the **active** state, it indicates that the bandwidth plan is associated.
 * *   The **BandwidthPackageAddAccelerator** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request BandwidthPackageAddAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BandwidthPackageAddAcceleratorResponse
 */
async function bandwidthPackageAddAcceleratorWithOptions(request: BandwidthPackageAddAcceleratorRequest, runtime: Util.RuntimeOptions): BandwidthPackageAddAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BandwidthPackageAddAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a bandwidth plan with a Global Accelerator (GA) instance.
 *
 * @description *   **BandwidthPackageAddAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the bandwidth plan that you want to associate.
 *     *   If the bandwidth plan is in the **binding** state, it indicates that the bandwidth plan is being associated. In this case, you can perform only query operations.
 *     *   If the bandwidth plan is in the **active** state, it indicates that the bandwidth plan is associated.
 * *   The **BandwidthPackageAddAccelerator** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request BandwidthPackageAddAcceleratorRequest
 * @return BandwidthPackageAddAcceleratorResponse
 */
async function bandwidthPackageAddAccelerator(request: BandwidthPackageAddAcceleratorRequest): BandwidthPackageAddAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return bandwidthPackageAddAcceleratorWithOptions(request, runtime);
}

model BandwidthPackageRemoveAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1qe94o52ot4pkfn****'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.

This parameter is required.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model BandwidthPackageRemoveAcceleratorResponseBody = {
  accelerators?: [ string ](name='Accelerators', description='The ID of the GA instance.'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B7770CB9-9745-4FE5-9EDA-D14B01A12A50'),
}

model BandwidthPackageRemoveAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BandwidthPackageRemoveAcceleratorResponseBody(name='body'),
}

/**
 * @summary Disassociates a bandwidth plan from a Global Accelerator (GA) instance.
 *
 * @description *   **BandwidthPackageRemoveAccelerator** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the bandwidth plan that you attempt to disassociate.
 *     *   If the bandwidth plan is in the **unbinding** state, it indicates that the bandwidth plan is being disassociated. In this case, you can perform only query operations.
 *     *   If the bandwidth plan is in the **active** state, it indicates that the bandwidth plan is disassociated.
 * *   The **BandwidthPackageRemoveAccelerator** cannot be called repeatedly for the same GA instance.
 *
 * @param request BandwidthPackageRemoveAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BandwidthPackageRemoveAcceleratorResponse
 */
async function bandwidthPackageRemoveAcceleratorWithOptions(request: BandwidthPackageRemoveAcceleratorRequest, runtime: Util.RuntimeOptions): BandwidthPackageRemoveAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BandwidthPackageRemoveAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a bandwidth plan from a Global Accelerator (GA) instance.
 *
 * @description *   **BandwidthPackageRemoveAccelerator** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the bandwidth plan that you attempt to disassociate.
 *     *   If the bandwidth plan is in the **unbinding** state, it indicates that the bandwidth plan is being disassociated. In this case, you can perform only query operations.
 *     *   If the bandwidth plan is in the **active** state, it indicates that the bandwidth plan is disassociated.
 * *   The **BandwidthPackageRemoveAccelerator** cannot be called repeatedly for the same GA instance.
 *
 * @param request BandwidthPackageRemoveAcceleratorRequest
 * @return BandwidthPackageRemoveAcceleratorResponse
 */
async function bandwidthPackageRemoveAccelerator(request: BandwidthPackageRemoveAcceleratorRequest): BandwidthPackageRemoveAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return bandwidthPackageRemoveAcceleratorWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **client token** can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the value of **RequestId** as the value of **ClientToken**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the new resource group.

This parameter is required.', example='rg-aekzrnd67gq****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the GA resource.

*   If you set **ResourceType** to **accelerator**, set the value of ResourceId to the ID of a standard GA instance.
*   If you set **ResourceType** to **basicaccelerator**, set the value of ResourceId to the ID of a basic GA instance.
*   If you set **ResourceType** to **bandwidthpackage**, set the value of ResourceId to the ID of a bandwidth plan.
*   If you set **ResourceType** to **acl**, set the value of ResourceId to the ID of an access control list (ACL).

This parameter is required.', example='ga-bp149u6o36qt1as9b****'),
  resourceType?: string(name='ResourceType', description='The type of the GA resource. Valid values:

*   **accelerator:** a standard GA instance.
*   **basicaccelerator:** a basic GA instance.
*   **bandwidthpackage:** a bandwidth plan.
*   **acl:** an ACL.

This parameter is required.', example='accelerator'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes the resource group to which a Global Accelerator (GA) resource belongs.
 *
 * @description The **ChangeResourceGroup** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the resource group to which a Global Accelerator (GA) resource belongs.
 *
 * @description The **ChangeResourceGroup** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model ConfigEndpointProbeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  enable?: string(name='Enable', description='Specifies whether to enable latency monitoring. Valid values:

*   **true**
*   **false** (default)

This parameter is required.', example='true'),
  endpoint?: string(name='Endpoint', description='The endpoint.

This parameter is required.', example='127.0.XX.XX'),
  endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointType?: string(name='EndpointType', description='The type of the endpoint. Valid values:

*   **Ip:** a custom IP address.
*   **Domain:** a custom domain name.
*   **EIP:** an Alibaba Cloud elastic IP address (EIP).
*   **PublicIp:** an Alibaba Cloud public IP address.

This parameter is required.', example='Ip'),
  probePort?: string(name='ProbePort', description='The port that is used to monitor latency. Valid values: **0** to **65535**.', example='80'),
  probeProtocol?: string(name='ProbeProtocol', description='The protocol that is used to monitor latency. Valid values:

*   **tcp:** TCP.
*   **icmp:** ICMP.', example='tcp'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ConfigEndpointProbeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model ConfigEndpointProbeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigEndpointProbeResponseBody(name='body'),
}

/**
 * @summary Configures latency monitoring for an endpoint.
 *
 * @description *   **ConfigEndpointProbe** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the status of the endpoint group to which an endpoint belongs and determine whether latency monitoring is configured for the endpoint.
 *     *   If the endpoint group is in the **updating** state, it indicates that latency monitoring is being configured for the endpoint. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that latency monitoring is configured for the endpoint.
 * *   The **ConfigEndpointProbe** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request ConfigEndpointProbeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigEndpointProbeResponse
 */
async function configEndpointProbeWithOptions(request: ConfigEndpointProbeRequest, runtime: Util.RuntimeOptions): ConfigEndpointProbeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.endpoint)) {
    query['Endpoint'] = request.endpoint;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointType)) {
    query['EndpointType'] = request.endpointType;
  }
  if (!Util.isUnset(request.probePort)) {
    query['ProbePort'] = request.probePort;
  }
  if (!Util.isUnset(request.probeProtocol)) {
    query['ProbeProtocol'] = request.probeProtocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigEndpointProbe',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Configures latency monitoring for an endpoint.
 *
 * @description *   **ConfigEndpointProbe** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the status of the endpoint group to which an endpoint belongs and determine whether latency monitoring is configured for the endpoint.
 *     *   If the endpoint group is in the **updating** state, it indicates that latency monitoring is being configured for the endpoint. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that latency monitoring is configured for the endpoint.
 * *   The **ConfigEndpointProbe** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request ConfigEndpointProbeRequest
 * @return ConfigEndpointProbeResponse
 */
async function configEndpointProbe(request: ConfigEndpointProbeRequest): ConfigEndpointProbeResponse {
  var runtime = new Util.RuntimeOptions{};
  return configEndpointProbeWithOptions(request, runtime);
}

model CreateAcceleratorRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: false. Valid values:

*   **false:** disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated.
*   **true:** enables automatic payment. Payments are automatically completed.', example='false'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the GA instance. Default value: false. Valid values:

*   **true:** enables auto-renewal.
*   **false:** disables auto-renewal.', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: months.

Valid values: **1** to **12**. Default value: **1**.

>  This parameter takes effect only when **AutoRenew** is set to **true**.', example='1'),
  autoUseCoupon?: string(name='AutoUseCoupon', description='Specifies whether to automatically use coupons when making payments. Default value: false. Valid values:

*   **true:** automatically pays bill by using coupons.
*   **false:** does not automatically pay bills by using coupons.

>  This parameter takes effect only when **AutoPay** is set to **true**.', example='false'),
  bandwidthBillingType?: string(name='BandwidthBillingType', description='The bandwidth billing method.

*   **BandwidthPackage:** billed based on bandwidth plans.
*   **CDT:** billed based on data transfer.
*   **CDT95:** billed based on the 95th percentile bandwidth. The billing is managed by Cloud Data Transfer (CDT). This bandwidth billing method is not available by default. Contact your Alibaba Cloud account manager for more information.', example='BandwidthPackage'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. The token can contain only ASCII characters.

>  If you do not set this parameter, the system sets **ClientToken** to the value of **RequestId**. The value of **RequestId** of each API request may be different.', example='123e4567****'),
  dryRun?: boolean(name='DryRun', description='Specifies whether only to precheck the request. Default value: false. Valid values:

*   **true**: prechecks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false**: sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  duration?: int32(name='Duration', description='The subscription duration of the GA instance.

*   If the **PricingCycle** parameter is set to **Month**, the valid values for the **Duration** parameter are **1** to **9**.
*   If the **PricingCycle** parameter is set to **Year**, the valid values for the **Duration** parameter are **1** to **3**.', example='1'),
  instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the GA. Default value is PREPAY (subscription).

*   PREPAY : subscription.
*   POSTPAY : pay-as-you-go', example='PREPAY'),
  ipSetConfig?: {
    accessMode?: string(name='AccessMode', description='The access mode of the acceleration area. Valid values:

*   **UserDefine:** custom nearby access mode. You can select acceleration areas and regions based on your business requirements. GA allocates a separate EIP to each acceleration region.
*   **Anycast:** automatic nearby access mode. You do not need to specify an acceleration area. GA allocates an Anycast EIP to multiple regions across the globe. Users can connect to the nearest access point of the Alibaba Cloud global transmission network by sending requests to the Anycast EIP.', example='UserDefine'),
  }(name='IpSetConfig', description='The configurations of the acceleration area.'),
  name?: string(name='Name', description='The name of the GA instance.

The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.', example='test'),
  pricingCycle?: string(name='PricingCycle', description='The billing cycle of the GA instance. Valid values:

*   **Month:** billed on a monthly basis.
*   **Year:** billed on an annual basis.', example='Month'),
  promotionOptionNo?: string(name='PromotionOptionNo', description='The coupon code.

>', example='50003298014****'),
  regionId?: string(name='RegionId', description='The ID of the region in which to create the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the standard GA instance belongs.', example='rg-aekzrnd67gq****'),
  spec?: string(name='Spec', description='The type of GA instance. Valid values:

*   **1:** Small Ⅰ
*   **2:** Small Ⅱ
*   **3:** Small Ⅲ
*   **5:** Medium Ⅰ
*   **8:** Medium Ⅱ
*   **10:** Medium Ⅲ
*   **20:** Large Ⅰ
*   **30:** Large Ⅱ
*   **40:** Large Ⅲ
*   **50:** Large Ⅳ
*   **60:** Large Ⅴ
*   **70:** Large Ⅵ
*   **80:** Large VⅡ
*   **90:** Large VⅢ
*   **100:** Super Large Ⅰ
*   **200:** Super Large Ⅱ

>  GA instances Large III and above are not available by default. To use these instances , contact your Alibaba Cloud account manager.

Each instance type provides different capabilities. For more information, see [Instance specifications](https://help.aliyun.com/document_detail/153127.html).', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the GA instance. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value of the GA instance. The tag value cannot be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='tag-value'),
    }
  ](name='Tag', description='The tags of the GA instance.'),
}

model CreateAcceleratorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp17frjjh0udz4qz****'),
  orderId?: string(name='OrderId', description='The ID of the order.

If you did not configure automatic payment, you must go to the [Order Center](https://usercenter2-intl.aliyun.com/order/list) to complete the payments.', example='208257****'),
  requestId?: string(name='RequestId', description='The request ID.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model CreateAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAcceleratorResponseBody(name='body'),
}

/**
 * @summary Creates a Global Accelerator (GA) instance.
 *
 * @description ## Description
 * **CreateAccelerator** is an asynchronous operation. After you send a request, the system returns the ID of a GA instance, but the operation is still being performed in the system background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the state of a GA instance.
 * *   If the GA instance is in the **init** state, it indicates that the GA instance is being created. In this case, you can perform only query operations.
 * *   If the GA instance is in the **active** state, it indicates that the GA instance is created.
 *
 * @param request CreateAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAcceleratorResponse
 */
async function createAcceleratorWithOptions(request: CreateAcceleratorRequest, runtime: Util.RuntimeOptions): CreateAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.autoRenewDuration)) {
    query['AutoRenewDuration'] = request.autoRenewDuration;
  }
  if (!Util.isUnset(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!Util.isUnset(request.bandwidthBillingType)) {
    query['BandwidthBillingType'] = request.bandwidthBillingType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.instanceChargeType)) {
    query['InstanceChargeType'] = request.instanceChargeType;
  }
  if (!Util.isUnset(request.ipSetConfig)) {
    query['IpSetConfig'] = request.ipSetConfig;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.promotionOptionNo)) {
    query['PromotionOptionNo'] = request.promotionOptionNo;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.spec)) {
    query['Spec'] = request.spec;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a Global Accelerator (GA) instance.
 *
 * @description ## Description
 * **CreateAccelerator** is an asynchronous operation. After you send a request, the system returns the ID of a GA instance, but the operation is still being performed in the system background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the state of a GA instance.
 * *   If the GA instance is in the **init** state, it indicates that the GA instance is being created. In this case, you can perform only query operations.
 * *   If the GA instance is in the **active** state, it indicates that the GA instance is created.
 *
 * @param request CreateAcceleratorRequest
 * @return CreateAcceleratorResponse
 */
async function createAccelerator(request: CreateAcceleratorRequest): CreateAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAcceleratorWithOptions(request, runtime);
}

model CreateAclRequest {
  aclEntries?: [ 
    {
      entry?: string(name='Entry', description='The IP addresses (192.168.XX.XX) or CIDR blocks (10.0.XX.XX/24) that you want to add to the ACL.

You can add a maximum of 50 entries at a time.', example='10.0.XX.XX/24'),
      entryDescription?: string(name='EntryDescription', description='The description of the entry that you want to add to the ACL.

You can add a maximum of 50 entries at a time.

The description must be 1 to 256 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).', example='test-entry'),
    }
  ](name='AclEntries', description='The entries of IP addresses or CIDR blocks to add to the ACL.

You can add a maximum of 50 entries at a time.'),
  aclName?: string(name='AclName', description='The ACL name.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test-acl'),
  addressIPVersion?: string(name='AddressIPVersion', description='The IP version of the ACL. Valid values:

*   **IPv4**
*   **IPv6**

This parameter is required.', example='IPv4'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to only precheck the request. Default value: false. Valid values:

*   **true**: prechecks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false**: sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmwj7wvng3jbi'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the ACL. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value of the ACL. The tag value cannot be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='tag-value'),
    }
  ](name='Tag', description='The tags of the ACL.'),
}

model CreateAclResponseBody = {
  aclId?: string(name='AclId', description='The ID of the ACL.', example='nacl-hp34s2h0xx1ht4nwo****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAclResponseBody(name='body'),
}

/**
 * @summary Creates an access control list (ACL).
 *
 * @description **CreateAcl** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) or [ListAcls](https://help.aliyun.com/document_detail/258291.html) operation to query the state of an ACL.
 * *   If the ACL is in the **init** state, the ACL is being created. In this case, you can only perform only query operations.
 * *   If the ACL is in the **active** state, the ACL is created.
 *
 * @param request CreateAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAclResponse
 */
async function createAclWithOptions(request: CreateAclRequest, runtime: Util.RuntimeOptions): CreateAclResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclEntries)) {
    query['AclEntries'] = request.aclEntries;
  }
  if (!Util.isUnset(request.aclName)) {
    query['AclName'] = request.aclName;
  }
  if (!Util.isUnset(request.addressIPVersion)) {
    query['AddressIPVersion'] = request.addressIPVersion;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAcl',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an access control list (ACL).
 *
 * @description **CreateAcl** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) or [ListAcls](https://help.aliyun.com/document_detail/258291.html) operation to query the state of an ACL.
 * *   If the ACL is in the **init** state, the ACL is being created. In this case, you can only perform only query operations.
 * *   If the ACL is in the **active** state, the ACL is created.
 *
 * @param request CreateAclRequest
 * @return CreateAclResponse
 */
async function createAcl(request: CreateAclRequest): CreateAclResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAclWithOptions(request, runtime);
}

model CreateApplicationMonitorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance on which you want to perform the origin probing task.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  address?: string(name='Address', description='The URL or IP address that you want to probe.

This parameter is required.', example='https://www.aliyun.com'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  detectEnable?: boolean(name='DetectEnable', description='Specifies whether to enable the automatic diagnostics feature. Valid values:

*   **true**
*   **false** (default)', example='false'),
  detectThreshold?: int32(name='DetectThreshold', description='The threshold that is used to trigger the automatic diagnostics feature. Unit: percentage.

Valid values: **0** to **100**.

The default value is **0**, which indicates that the automatic diagnostics feature is not triggered.', example='0'),
  detectTimes?: int32(name='DetectTimes', description='The number of times that the threshold must be reached before the automatic diagnostics feature is triggered.

Valid values: **1** to **20**. Default value: **1**.', example='1'),
  listenerId?: string(name='ListenerId', description='The ID of the listener on which you want to perform the origin probing task.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  optionsJson?: string(name='OptionsJson', description='The extended options of the listener protocol that is used by the origin probing task. The options vary based on the listener protocol.', example='{ "http_method": "get","header": "key:asd","acceptable_response_code": "500","cert_verify": true }'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  silenceTime?: int32(name='SilenceTime', description='The silence period of the automatic diagnostics feature. This parameter specifies the interval at which the automatic diagnostics feature is triggered. If the availability rate does not return to normal after GA triggers an automatic diagnostic task, GA must wait until the silence period ends before GA can trigger another automatic diagnostic task.

If the number of consecutive times that the availability rate drops below the threshold of automatic diagnostics reaches the value of **DetectTimes**, the automatic diagnostics feature is triggered. The automatic diagnostics feature is not triggered again within the silence period even if the availability rate remains below the threshold. If the availability rate does not return to normal after the silence period ends, the automatic diagnostics feature is triggered again.

Unit: seconds. Valid values: **300** to **86400**. Default value: **300**.', example='300'),
  taskName?: string(name='TaskName', description='The name of the origin probing task.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

This parameter is required.', example='task1'),
}

model CreateApplicationMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task.', example='sm-bp1fpdjfju9k8yr1y****'),
}

model CreateApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Creates an origin probing task.
 *
 * @description You can call the **CreateApplicationMonitor** operation to create an origin probing task. An origin probing task monitors the network quality between a client and an origin server and checks the availability of the origin server.
 * Before you call this operation, take note of the following items:
 * *   You can create origin detection tasks only for subscription Standard Global Accelerator (GA) instances whose specification is Medium Ⅰ.
 * *   You cannot create an origin probe task for a UDP listener.
 * *   The service port of the URL or IP address that is probed must be within the listening port range.
 * *   **CreateApplicationMonitor** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeApplicationMonitor](https://help.aliyun.com/document_detail/408463.html) or [ListApplicationMonitor](https://help.aliyun.com/document_detail/408462.html) operation to query the status of the origin probing task.
 *     *   If the origin probing task is in the **init** state, it indicates that the task is being created. You can perform only query operations.
 *     *   If the origin probing task is in the **active** state, it indicates that the task is created.
 * *   The **CreateApplicationMonitor** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 *
 * @param request CreateApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApplicationMonitorResponse
 */
async function createApplicationMonitorWithOptions(request: CreateApplicationMonitorRequest, runtime: Util.RuntimeOptions): CreateApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.detectEnable)) {
    query['DetectEnable'] = request.detectEnable;
  }
  if (!Util.isUnset(request.detectThreshold)) {
    query['DetectThreshold'] = request.detectThreshold;
  }
  if (!Util.isUnset(request.detectTimes)) {
    query['DetectTimes'] = request.detectTimes;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.optionsJson)) {
    query['OptionsJson'] = request.optionsJson;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an origin probing task.
 *
 * @description You can call the **CreateApplicationMonitor** operation to create an origin probing task. An origin probing task monitors the network quality between a client and an origin server and checks the availability of the origin server.
 * Before you call this operation, take note of the following items:
 * *   You can create origin detection tasks only for subscription Standard Global Accelerator (GA) instances whose specification is Medium Ⅰ.
 * *   You cannot create an origin probe task for a UDP listener.
 * *   The service port of the URL or IP address that is probed must be within the listening port range.
 * *   **CreateApplicationMonitor** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeApplicationMonitor](https://help.aliyun.com/document_detail/408463.html) or [ListApplicationMonitor](https://help.aliyun.com/document_detail/408462.html) operation to query the status of the origin probing task.
 *     *   If the origin probing task is in the **init** state, it indicates that the task is being created. You can perform only query operations.
 *     *   If the origin probing task is in the **active** state, it indicates that the task is created.
 * *   The **CreateApplicationMonitor** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 *
 * @param request CreateApplicationMonitorRequest
 * @return CreateApplicationMonitorResponse
 */
async function createApplicationMonitor(request: CreateApplicationMonitorRequest): CreateApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApplicationMonitorWithOptions(request, runtime);
}

model CreateBandwidthPackageRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **false** (default): disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated.
*   **true**: enables automatic payment. Payments are automatically completed.', example='false'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the bandwidth plan. Valid values:

*   **true**: enables auto-renewal.
*   **false** (default): does not enable auto-renewal.', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: months.

Valid values: **1** to **12**. Default value: **1**.

>  This parameter is required only if **AutoRenew** is set to **true**.', example='1'),
  autoUseCoupon?: string(name='AutoUseCoupon', description='Specifies whether to automatically pay bills by using coupons. Valid values:

*   **true**: yes
*   **false** (default): no

>  This parameter is required only if **AutoPay** is set to **true**.', example='false'),
  bandwidth?: int32(name='Bandwidth', description='The bandwidth of the bandwidth plan. Unit: Mbit/s.

Valid values: **2** to **2000**.

This parameter is required.', example='2'),
  bandwidthType?: string(name='BandwidthType', description='The type of the bandwidth. Valid values:

*   **Basic**: standard bandwidth
*   **Enhanced**: enhanced bandwidth
*   **Advanced**: premium bandwidth

If **Type** is set to **Basic**, this parameter is required.', example='Basic'),
  billingType?: string(name='BillingType', description='The metering method that is used when you use the pay-as-you-go billing method. Valid values:

*   **PayByTraffic** (default)
*   **PayBY95** By default, the pay-by-95th-percentile metering method is unavailable. If you want to use the metering method, contact your account manager.

>  This parameter takes effect only if you set **ChargeType** to **POSTPAY**.', example='PayByTraffic'),
  cbnGeographicRegionIdA?: string(name='CbnGeographicRegionIdA', description='Area A to be connected. Set the value to **China-mainland**.

You can set this parameter only if you call this operation on the international site (alibabacloud.com).', example='China-mainland'),
  cbnGeographicRegionIdB?: string(name='CbnGeographicRegionIdB', description='Area B to be connected. Set the value to **Global**.

You can set this parameter only if you call this operation on the international site (alibabacloud.com).', example='Global'),
  chargeType?: string(name='ChargeType', description='The billing method of the bandwidth plan. Valid values:

*   **PREPAY** (default): subscription.
*   **POSTPAY**: pay-as-you-go. By default, the pay-as-you-go billing method is unavailable. If you want to use the billing method, contact your account manager.', example='PREPAY'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567****'),
  duration?: string(name='Duration', description='The subscription duration.

*   If the **PricingCycle** parameter is set to **Month**, the valid values for the **Duration** parameter are **1** to **9**.
*   If the **PricingCycle** parameter is set to **Year**, the valid values for the **Duration** parameter are **1** to **3**.

If **ChargeType** is set to **PREPAY**, this parameter is required.', example='1'),
  pricingCycle?: string(name='PricingCycle', description='The billing cycle. Valid values:

*   **Month**: billed on a monthly basis.
*   **Year**: billed on an annual basis.

If **ChargeType** is set to **PREPAY**, this parameter is required.', example='Month'),
  promotionOptionNo?: string(name='PromotionOptionNo', description='The coupon code.

>  This parameter is only available on the international site (alibabacloud.com).', example='50003298014****'),
  ratio?: int32(name='Ratio', description='The percentage of the minimum bandwidth guaranteed if the pay-by-95th-percentile-bandwidth metering method is used. Valid values: **30** to **100**.

>  This parameter is required only if **BillingType** is set to **PayBY95**.', example='30'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. **cn-hangzhou** is returned.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzrnd67gq****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag keys cannot be an empty string. The tag key can be up to 64 characters in length, and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value.

Each tag key corresponds to a tag value. Valid values of **N**: **1** to **20**.

The value cannot exceed 128 characters in length, and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.', example='tag-value'),
    }
  ](name='Tag', description='The tags to add to the bandwidth plan.'),
  type?: string(name='Type', description='The type of the bandwidth plan. Valid values:

*   **Basic**: a basic bandwidth plan
*   **CrossDomain**: a cross-region acceleration bandwidth plan

If you call this operation on the Alibaba Cloud China site, only **Basic** is supported.

This parameter is required.', example='Basic'),
}

model CreateBandwidthPackageResponseBody = {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  orderId?: string(name='OrderId', description='The order ID.

If bills are not automatically paid, you must go to the Order Center to complete the payments.

This parameter is returned only if ChargeType is set to PREPAY. If AutoPay is set to false, you must go to the [Order Center](https://usercenter2-intl.aliyun.com/order/list) to complete the payment.', example='208257****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4B6DBBB0-2D01-4C6A-A384-4129266E6B78'),
}

model CreateBandwidthPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBandwidthPackageResponseBody(name='body'),
}

/**
 * @summary Creates a bandwidth plan.
 *
 * @description To use Global Accelerator (GA) for acceleration, you must purchase a basic bandwidth plan. A basic bandwidth plan supports the following bandwidth types:
 * *   **Basic**: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service is deployed on Alibaba Cloud.
 * *   **Enhanced**: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service can be deployed on and off Alibaba Cloud.
 * *   **Premium**: Both the default acceleration region and the default service region are outside the Chinese mainland. The accelerated service can be deployed on and off Alibaba Cloud. If you want to accelerate data transfer for clients in the Chinese mainland, you must select China (Hong Kong) as the acceleration region.
 * When you call this operation, take note of the following items:
 * *   **CreateBandwidthPackage** is an asynchronous operation. After you send a request, the system returns the ID of a bandwidth plan, but the bandwidth plan is still being created in the system background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the bandwidth plan.
 *     *   If the bandwidth plan is in the **init** state, it indicates that the bandwidth plan is being created. In this case, you can perform only query operations.
 *     *   If the bandwidth plan is in the **active** state, it indicates that the bandwidth plan is created.
 * *   The **CreateBandwidthPackage** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request CreateBandwidthPackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBandwidthPackageResponse
 */
async function createBandwidthPackageWithOptions(request: CreateBandwidthPackageRequest, runtime: Util.RuntimeOptions): CreateBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.autoRenewDuration)) {
    query['AutoRenewDuration'] = request.autoRenewDuration;
  }
  if (!Util.isUnset(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.bandwidthType)) {
    query['BandwidthType'] = request.bandwidthType;
  }
  if (!Util.isUnset(request.billingType)) {
    query['BillingType'] = request.billingType;
  }
  if (!Util.isUnset(request.cbnGeographicRegionIdA)) {
    query['CbnGeographicRegionIdA'] = request.cbnGeographicRegionIdA;
  }
  if (!Util.isUnset(request.cbnGeographicRegionIdB)) {
    query['CbnGeographicRegionIdB'] = request.cbnGeographicRegionIdB;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.promotionOptionNo)) {
    query['PromotionOptionNo'] = request.promotionOptionNo;
  }
  if (!Util.isUnset(request.ratio)) {
    query['Ratio'] = request.ratio;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBandwidthPackage',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a bandwidth plan.
 *
 * @description To use Global Accelerator (GA) for acceleration, you must purchase a basic bandwidth plan. A basic bandwidth plan supports the following bandwidth types:
 * *   **Basic**: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service is deployed on Alibaba Cloud.
 * *   **Enhanced**: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service can be deployed on and off Alibaba Cloud.
 * *   **Premium**: Both the default acceleration region and the default service region are outside the Chinese mainland. The accelerated service can be deployed on and off Alibaba Cloud. If you want to accelerate data transfer for clients in the Chinese mainland, you must select China (Hong Kong) as the acceleration region.
 * When you call this operation, take note of the following items:
 * *   **CreateBandwidthPackage** is an asynchronous operation. After you send a request, the system returns the ID of a bandwidth plan, but the bandwidth plan is still being created in the system background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the bandwidth plan.
 *     *   If the bandwidth plan is in the **init** state, it indicates that the bandwidth plan is being created. In this case, you can perform only query operations.
 *     *   If the bandwidth plan is in the **active** state, it indicates that the bandwidth plan is created.
 * *   The **CreateBandwidthPackage** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request CreateBandwidthPackageRequest
 * @return CreateBandwidthPackageResponse
 */
async function createBandwidthPackage(request: CreateBandwidthPackageRequest): CreateBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBandwidthPackageWithOptions(request, runtime);
}

model CreateBasicAccelerateIpRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.

You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/2253380.html) operation to query the region ID.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicAccelerateIpResponseBody = {
  accelerateIpAddress?: string(name='AccelerateIpAddress', description='The accelerated IP address.', example='116.132.XX.XX'),
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.', example='ips-bp11r5jb8ogp122xl****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The status of the accelerated IP address.

>  This parameter returns an empty string because the parameter is not in use.', example='null'),
}

model CreateBasicAccelerateIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicAccelerateIpResponseBody(name='body'),
}

/**
 * @summary Creates an accelerated IP address for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicAccelerateIp** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) operation to query the status of an accelerated IP address:
 *     *   If no status information is returned, the accelerated IP address is being created. In this case, you can perform only query operations.
 *     *   If the accelerated IP address is in the **active** state, the accelerated IP address is created.
 * *   The **CreateBasicAccelerateIp** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request CreateBasicAccelerateIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicAccelerateIpResponse
 */
async function createBasicAccelerateIpWithOptions(request: CreateBasicAccelerateIpRequest, runtime: Util.RuntimeOptions): CreateBasicAccelerateIpResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicAccelerateIp',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an accelerated IP address for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicAccelerateIp** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) operation to query the status of an accelerated IP address:
 *     *   If no status information is returned, the accelerated IP address is being created. In this case, you can perform only query operations.
 *     *   If the accelerated IP address is in the **active** state, the accelerated IP address is created.
 * *   The **CreateBasicAccelerateIp** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request CreateBasicAccelerateIpRequest
 * @return CreateBasicAccelerateIpResponse
 */
async function createBasicAccelerateIp(request: CreateBasicAccelerateIpRequest): CreateBasicAccelerateIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicAccelerateIpWithOptions(request, runtime);
}

model CreateBasicAccelerateIpEndpointRelationRequest {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.

You can call the [ListBasicAccelerateIps](https://help.aliyun.com/document_detail/2253393.html) operation to query the ID of the accelerated IP address.

This parameter is required.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.

You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/2253406.html) operation to query the ID of the endpoint.

This parameter is required.', example='ep-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicAccelerateIpEndpointRelationResponseBody = {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address of the basic GA instance.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint that is associated with the basic GA instance.', example='ep-bp14sz7ftcwwjgrdm****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The status of the mapping between the accelerated IP address and the endpoint.

>  This parameter is not in use.', example='null'),
}

model CreateBasicAccelerateIpEndpointRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicAccelerateIpEndpointRelationResponseBody(name='body'),
}

/**
 * @summary Creates a mapping between an accelerated IP address and an endpoint for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicAccelerateIpEndpointRelation** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) or [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) API operation to query the status of an accelerated IP address or an endpoint to determine the association status between the accelerated IP address and endpoint.
 *     *   If the status of the accelerated IP address and endpoint is **binding**, the accelerated IP address is being associated with the endpoint. In this case, you can query the accelerated IP address and endpoint but cannot perform other operations.
 *     *   If the status of the accelerated IP address and endpoint is **bound** and the status returned by the [ListBasicAccelerateIpEndpointRelations](https://help.aliyun.com/document_detail/466803.html) API operation is **active**, the accelerated IP address is associated with the endpoint.
 * *   The **CreateBasicAccelerateIpEndpointRelation** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request CreateBasicAccelerateIpEndpointRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicAccelerateIpEndpointRelationResponse
 */
async function createBasicAccelerateIpEndpointRelationWithOptions(request: CreateBasicAccelerateIpEndpointRelationRequest, runtime: Util.RuntimeOptions): CreateBasicAccelerateIpEndpointRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicAccelerateIpEndpointRelation',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a mapping between an accelerated IP address and an endpoint for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicAccelerateIpEndpointRelation** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) or [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) API operation to query the status of an accelerated IP address or an endpoint to determine the association status between the accelerated IP address and endpoint.
 *     *   If the status of the accelerated IP address and endpoint is **binding**, the accelerated IP address is being associated with the endpoint. In this case, you can query the accelerated IP address and endpoint but cannot perform other operations.
 *     *   If the status of the accelerated IP address and endpoint is **bound** and the status returned by the [ListBasicAccelerateIpEndpointRelations](https://help.aliyun.com/document_detail/466803.html) API operation is **active**, the accelerated IP address is associated with the endpoint.
 * *   The **CreateBasicAccelerateIpEndpointRelation** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request CreateBasicAccelerateIpEndpointRelationRequest
 * @return CreateBasicAccelerateIpEndpointRelationResponse
 */
async function createBasicAccelerateIpEndpointRelation(request: CreateBasicAccelerateIpEndpointRelationRequest): CreateBasicAccelerateIpEndpointRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicAccelerateIpEndpointRelationWithOptions(request, runtime);
}

model CreateBasicAccelerateIpEndpointRelationsRequest {
  accelerateIpEndpointRelations?: [ 
    {
      accelerateIpId?: string(name='AccelerateIpId', description='The IDs of the accelerated IP addresses.

You can call the [ListBasicAccelerateIps](https://help.aliyun.com/document_detail/2253393.html) operation to query the IDs of the accelerated IP addresses.

You can specify up to 20 IP address IDs.', example='gaip-bp1****'),
      endpointId?: string(name='EndpointId', description='The IDs of the endpoints.

You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/2253406.html) to query the IDs of the endpoints.

You can specify up to 20 endpoint IDs.', example='ep-bp14sz7ftcwwjgrdm****'),
    }
  ](name='AccelerateIpEndpointRelations', description='A list of accelerated IP addresses and the endpoints with which the accelerated IP addresses are associated.

This parameter is required.'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicAccelerateIpEndpointRelationsResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateBasicAccelerateIpEndpointRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicAccelerateIpEndpointRelationsResponseBody(name='body'),
}

/**
 * @summary Creates mappings between accelerated IP addresses and endpoints for a basic Global Accelerator (GA) instance.
 *
 * @description *   The **CreateBasicAccelerateIpEndpointRelations** is asynchronous. After you send a request, the system returns a request ID and runs the task in the system background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) or [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) API operation to query the status of an accelerated IP address or an endpoint to determine the association status.
 *     *   If an accelerated IP address and the endpoint are in the **binding** state, the accelerated IP address is being associated with the endpoint. In this case, you can only query the accelerated IP address and endpoint, but cannot perform other operations.
 *     *   If all the accelerated IP addresses and the endpoint are in the **bound** state, and the association status returned by the [ListBasicAccelerateIpEndpointRelations](https://help.aliyun.com/document_detail/466803.html) API operation is **active**, the accelerated IP addresses are associated with the endpoints.
 * *   The **CreateBasicAccelerateIpEndpointRelations** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request CreateBasicAccelerateIpEndpointRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicAccelerateIpEndpointRelationsResponse
 */
async function createBasicAccelerateIpEndpointRelationsWithOptions(request: CreateBasicAccelerateIpEndpointRelationsRequest, runtime: Util.RuntimeOptions): CreateBasicAccelerateIpEndpointRelationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpEndpointRelations)) {
    query['AccelerateIpEndpointRelations'] = request.accelerateIpEndpointRelations;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicAccelerateIpEndpointRelations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates mappings between accelerated IP addresses and endpoints for a basic Global Accelerator (GA) instance.
 *
 * @description *   The **CreateBasicAccelerateIpEndpointRelations** is asynchronous. After you send a request, the system returns a request ID and runs the task in the system background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) or [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) API operation to query the status of an accelerated IP address or an endpoint to determine the association status.
 *     *   If an accelerated IP address and the endpoint are in the **binding** state, the accelerated IP address is being associated with the endpoint. In this case, you can only query the accelerated IP address and endpoint, but cannot perform other operations.
 *     *   If all the accelerated IP addresses and the endpoint are in the **bound** state, and the association status returned by the [ListBasicAccelerateIpEndpointRelations](https://help.aliyun.com/document_detail/466803.html) API operation is **active**, the accelerated IP addresses are associated with the endpoints.
 * *   The **CreateBasicAccelerateIpEndpointRelations** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request CreateBasicAccelerateIpEndpointRelationsRequest
 * @return CreateBasicAccelerateIpEndpointRelationsResponse
 */
async function createBasicAccelerateIpEndpointRelations(request: CreateBasicAccelerateIpEndpointRelationsRequest): CreateBasicAccelerateIpEndpointRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicAccelerateIpEndpointRelationsWithOptions(request, runtime);
}

model CreateBasicAcceleratorRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **false:** disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated. This is the default value.
*   **true:** enables automatic payment. Payments are automatically completed.', example='false'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the basic GA instance. Valid values:

*   **true:** enables auto-renewal for the basic GA instance.
*   **false:** disables auto-renewal for the basic GA instance. This is the default value.', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: months.

Valid values: **1** to **12**. Default value: **1**.

>  This parameter takes effect only when the **AutoPay** parameter is set to **true**.', example='1'),
  autoUseCoupon?: string(name='AutoUseCoupon', description='Specifies whether to automatically apply coupons to your bills. Valid values:

*   **true:** automatically applies coupons to your bills.
*   **false:** does not automatically apply coupons to your bills. This is the default value.

>  This parameter takes effect only when the **AutoPay** parameter is set to **true**.', example='false'),
  bandwidthBillingType?: string(name='BandwidthBillingType', description='The bandwidth billing method. Valid values:

*   **BandwidthPackage:** billed based on bandwidth plans.
*   **CDT:** billed based on data transfer. The bills are managed by using Cloud Data Transfer (CDT).
*   **CDT95:** billed based on the 95th percentile bandwidth. The bills are managed by using Cloud Data Transfer (CDT). This bandwidth billing method is not available by default. Contact your Alibaba Cloud account manager for more information.', example='CDT'),
  chargeType?: string(name='ChargeType', description='The billing method. Valid values:

*   **PREPAY** (default)
*   **POSTPAY**', example='PREPAY'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567****'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true:** performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed. This is the default value.', example='false'),
  duration?: int32(name='Duration', description='The subscription duration of the GA instance.

*   If you set **PricingCycle** to **Month**, the valid values for **Duration** are **1** to **9**.
*   If you set **PricingCycle** to **Year**, the valid values for **Duration** are **1** to **3**.', example='1'),
  pricingCycle?: string(name='PricingCycle', description='The billing cycle. Valid values:

*   **Month**
*   **Year**', example='Month'),
  promotionOptionNo?: string(name='PromotionOptionNo', description='The code of the coupon.

>  This parameter takes effect only for accounts registered on the international site (alibabacloud.com).', example='50003298014****'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the basic GA instance belongs.', example='rg-acfmxshhcsn****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. The tag key cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value. The tag value cannot be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `acs:` or `aliyun`.

You can specify up to 20 tag values.', example='tag-value'),
    }
  ](name='Tag', description='The tags of the basic GA instance.'),
}

model CreateBasicAcceleratorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  orderId?: string(name='OrderId', description='The order ID.

This parameter is returned only if ChargeType is set to PREPAY.

If **AutoPay** is set to **false**, go to [Order Center](https://usercenter2-intl.aliyun.com/order/list) to complete the payment after an order is generated.', example='2082574365'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model CreateBasicAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicAcceleratorResponseBody(name='body'),
}

/**
 * @summary Basic Global Accelerator (GA) instances leverage the immense bandwidth of the high-quality global network of Alibaba Cloud to provide end-to-end acceleration services. You can use basic GA instances to accelerate content delivery at Layer 3 (IP). You can call the CreateBasicAccelerator operation to create a basic GA instance.
 *
 * @description **CreateBasicAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/353188.html) or [ListBasicAccelerators](https://help.aliyun.com/document_detail/353189.html) operation to query the status of the task.
 * *   If the basic GA instance is in the **init** state, it indicates that the basic GA instance is being created. In this case, you can perform only query operations.
 * *   If the basic GA instance is in the **active** state, it indicates that the basic GA instance is created.
 *
 * @param request CreateBasicAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicAcceleratorResponse
 */
async function createBasicAcceleratorWithOptions(request: CreateBasicAcceleratorRequest, runtime: Util.RuntimeOptions): CreateBasicAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.autoRenewDuration)) {
    query['AutoRenewDuration'] = request.autoRenewDuration;
  }
  if (!Util.isUnset(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!Util.isUnset(request.bandwidthBillingType)) {
    query['BandwidthBillingType'] = request.bandwidthBillingType;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.promotionOptionNo)) {
    query['PromotionOptionNo'] = request.promotionOptionNo;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Basic Global Accelerator (GA) instances leverage the immense bandwidth of the high-quality global network of Alibaba Cloud to provide end-to-end acceleration services. You can use basic GA instances to accelerate content delivery at Layer 3 (IP). You can call the CreateBasicAccelerator operation to create a basic GA instance.
 *
 * @description **CreateBasicAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/353188.html) or [ListBasicAccelerators](https://help.aliyun.com/document_detail/353189.html) operation to query the status of the task.
 * *   If the basic GA instance is in the **init** state, it indicates that the basic GA instance is being created. In this case, you can perform only query operations.
 * *   If the basic GA instance is in the **active** state, it indicates that the basic GA instance is created.
 *
 * @param request CreateBasicAcceleratorRequest
 * @return CreateBasicAcceleratorResponse
 */
async function createBasicAccelerator(request: CreateBasicAcceleratorRequest): CreateBasicAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicAcceleratorWithOptions(request, runtime);
}

model CreateBasicEndpointRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.

This parameter is required.', example='eni-bp1a05txelswuj8g****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is required if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, you can set **EndpointSubAddress** to the secondary private IP address of the primary ENI. If the parameter is left empty, the primary private IP address of the primary ENI is used.
*   If the endpoint type is **ENI**, you can set **EndpointSubAddress** to the secondary private IP address of the secondary ENI. If the parameter is left empty, the primary private IP address of the secondary ENI is used.
*   This parameter is required if the endpoint type is **NLB**. **EndpointSubAddress** is the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
  endpointSubAddressType?: string(name='EndpointSubAddressType', description='The type of the secondary address of the endpoint. Valid values:

*   **primary**: a primary private IP address.
*   **secondary**: a secondary private IP address.

This parameter is required if the endpoint type is **ECS**, **ENI**, or **NLB**. If the endpoint type is **NLB**, only **primary** is supported.', example='primary'),
  endpointType?: string(name='EndpointType', description='The type of endpoint. Valid values:

*   **ENI**: elastic network interface (ENI)
*   **SLB**: Classic Load Balancer (CLB)
*   **ECS**: Elastic Compute Service (ECS)
*   **NLB**: Network Load Balancer (NLB)

This parameter is required.', example='ENI'),
  endpointZoneId?: string(name='EndpointZoneId', description='The zone ID of the endpoint.

This parameter is required only if the endpoint type is **NLB**.', example='cn-hangzhou-g'),
  name?: string(name='Name', description='The name of the endpoint that is associated with the basic GA instance.

The name must be 1 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.', example='ep01'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicEndpointResponseBody = {
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateBasicEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicEndpointResponseBody(name='body'),
}

/**
 * @summary Creates an endpoint for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicEndpoint** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) API operation to query the status of an endpoint.
 *     *   If the endpoint is in the **init** state, the endpoint is being created. In this case, you can perform only query operations.
 *     *   If the endpoint is in the **active** state, the endpoint is created.
 * *   The **CreateBasicEndpoint** API operation cannot be repeatedly called for the same basic GA instance within a specific period of time.
 *
 * @param request CreateBasicEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicEndpointResponse
 */
async function createBasicEndpointWithOptions(request: CreateBasicEndpointRequest, runtime: Util.RuntimeOptions): CreateBasicEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointAddress)) {
    query['EndpointAddress'] = request.endpointAddress;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointSubAddress)) {
    query['EndpointSubAddress'] = request.endpointSubAddress;
  }
  if (!Util.isUnset(request.endpointSubAddressType)) {
    query['EndpointSubAddressType'] = request.endpointSubAddressType;
  }
  if (!Util.isUnset(request.endpointType)) {
    query['EndpointType'] = request.endpointType;
  }
  if (!Util.isUnset(request.endpointZoneId)) {
    query['EndpointZoneId'] = request.endpointZoneId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicEndpoint',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an endpoint for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicEndpoint** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) API operation to query the status of an endpoint.
 *     *   If the endpoint is in the **init** state, the endpoint is being created. In this case, you can perform only query operations.
 *     *   If the endpoint is in the **active** state, the endpoint is created.
 * *   The **CreateBasicEndpoint** API operation cannot be repeatedly called for the same basic GA instance within a specific period of time.
 *
 * @param request CreateBasicEndpointRequest
 * @return CreateBasicEndpointResponse
 */
async function createBasicEndpoint(request: CreateBasicEndpointRequest): CreateBasicEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicEndpointWithOptions(request, runtime);
}

model CreateBasicEndpointGroupRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the endpoint group.

The description can be up to 200 characters in length and cannot start with `http://` or `https://`.', example='BasicEndpointGroup'),
  endpointAddress?: string(name='EndpointAddress', description='The endpoint address.', example='eni-bp1a05txelswuj8g****'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region to which the endpoint group belongs.

You can call the [ListAvailableBusiRegions](https://help.aliyun.com/document_detail/2253223.html) operation to query the region ID.

This parameter is required.', example='cn-shanghai'),
  endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

You must specify this parameter when the accelerated IP address is associated with the secondary private IP address of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).

*   When the endpoint type is **ECS**, you can set **EndpointSubAddress** to the secondary private IP address of the primary ENI. If the parameter is left empty, the primary private IP address of the primary ENI is used.
*   If the endpoint type is **ENI**, you can set **EndpointSubAddress** to the secondary private IP address of the secondary ENI. If the parameter is left empty, the primary private IP address of the secondary ENI is used.', example='172.16.XX.XX'),
  endpointType?: string(name='EndpointType', description='The type of the endpoint. Valid values:

*   **ENI**
*   **SLB**
*   **ECS**', example='ENI'),
  name?: string(name='Name', description='The name of the endpoint group.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.', example='group1'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicEndpointGroupResponseBody = {
  endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.', example='epg-bp1dmlohjjz4kqaun****'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateBasicEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Creates an endpoint group for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicEndpointGroup** is an asynchronous operation. After a request is sent, the system returns an endpoint group ID and runs the task in the background. You can call the [GetBasicEndpointGroup](https://help.aliyun.com/document_detail/362984.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **init** state, the endpoint is being created. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, the endpoint group is created.
 * *   You cannot call the **CreateBasicEndpointGroup** operation again on the same GA instance before the previous request is completed.
 *
 * @param request CreateBasicEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicEndpointGroupResponse
 */
async function createBasicEndpointGroupWithOptions(request: CreateBasicEndpointGroupRequest, runtime: Util.RuntimeOptions): CreateBasicEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointAddress)) {
    query['EndpointAddress'] = request.endpointAddress;
  }
  if (!Util.isUnset(request.endpointGroupRegion)) {
    query['EndpointGroupRegion'] = request.endpointGroupRegion;
  }
  if (!Util.isUnset(request.endpointSubAddress)) {
    query['EndpointSubAddress'] = request.endpointSubAddress;
  }
  if (!Util.isUnset(request.endpointType)) {
    query['EndpointType'] = request.endpointType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an endpoint group for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicEndpointGroup** is an asynchronous operation. After a request is sent, the system returns an endpoint group ID and runs the task in the background. You can call the [GetBasicEndpointGroup](https://help.aliyun.com/document_detail/362984.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **init** state, the endpoint is being created. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, the endpoint group is created.
 * *   You cannot call the **CreateBasicEndpointGroup** operation again on the same GA instance before the previous request is completed.
 *
 * @param request CreateBasicEndpointGroupRequest
 * @return CreateBasicEndpointGroupResponse
 */
async function createBasicEndpointGroup(request: CreateBasicEndpointGroupRequest): CreateBasicEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicEndpointGroupWithOptions(request, runtime);
}

model CreateBasicEndpointsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpoints?: [ 
    {
      endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
      endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is required only if you set the endpoint type to **ECS**, **ENI**, or **NLB**.

*   If you set the endpoint type to **ECS**, you can set **EndpointSubAddress** to the secondary private IP address of the primary ENI. If you leave this parameter empty, the primary private IP address of the primary ENI is used.
*   If you set the endpoint type to **ENI**, you can set **EndpointSubAddress** to the secondary private IP address of the secondary ENI. If you leave this parameter empty, the primary private IP address of the secondary ENI is used.
*   If you set the endpoint type to **NLB**, you can set **EndpointSubAddress** to the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
      endpointSubAddressType?: string(name='EndpointSubAddressType', description='The secondary address type of the endpoint. Valid values:

*   **primary**: a primary private IP address.
*   **secondary**: a secondary private IP address.

This parameter is required only if you set the endpoint type to **ECS**, **ENI**, or **NLB**. If you set the endpoint type to **NLB**, only **primary** is supported.', example='primary'),
      endpointType?: string(name='EndpointType', description='The type of the endpoint. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.
*   **NLB**: Network Load Balancer (NLB) instance.

>  This parameter is required.', example='ENI'),
      endpointZoneId?: string(name='EndpointZoneId', description='The ID of the zone where the endpoint resides.

This parameter is required only if you set the endpoint type to **NLB**.', example='cn-hangzhou-g'),
      name?: string(name='Name', description='The name of the endpoint.

The name must be 1 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.', example='ep01'),
    }
  ](name='Endpoints', description='The endpoints.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicEndpointsResponseBody = {
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp1dmlohjjz4kqaun****'),
  endpoints?: [ 
    {
      endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
      endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
      endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, **EndpointSubAddress** returns the primary or secondary private IP address of the primary ENI.
*   If the endpoint type is **ENI**, **EndpointSubAddress** returns the primary or secondary private IP address of the secondary ENI.
*   If the endpoint type is **NLB**, **EndpointSubAddress** returns the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
      endpointType?: string(name='EndpointType', description='The type of the endpoint. Valid values:

*   **ENI:** ENI.
*   **SLB:** CLB instance.
*   **ECS:** ECS instance.
*   **NLB:** NLB instance.', example='ENI'),
    }
  ](name='Endpoints', description='The endpoints in the endpoint group.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateBasicEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicEndpointsResponseBody(name='body'),
}

/**
 * @summary Creates multiple endpoints for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicEndpoints** is an asynchronous operation. After you call this operation, the system returns a request ID and runs the task in the background. You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) operation to query the status of endpoints. - If one or more endpoints are in the **init** state, it indicates that the endpoints are being created. In this case, you can continue to perform query operations on the endpoints. If all endpoints are in the **active** state, it indicates that the endpoints are created.
 * *   You cannot call the **CreateBasicEndpoints** operation again on the same GA instance before the previous operation is complete.
 *
 * @param request CreateBasicEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicEndpointsResponse
 */
async function createBasicEndpointsWithOptions(request: CreateBasicEndpointsRequest, runtime: Util.RuntimeOptions): CreateBasicEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpoints)) {
    query['Endpoints'] = request.endpoints;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicEndpoints',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates multiple endpoints for a basic Global Accelerator (GA) instance.
 *
 * @description *   **CreateBasicEndpoints** is an asynchronous operation. After you call this operation, the system returns a request ID and runs the task in the background. You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) operation to query the status of endpoints. - If one or more endpoints are in the **init** state, it indicates that the endpoints are being created. In this case, you can continue to perform query operations on the endpoints. If all endpoints are in the **active** state, it indicates that the endpoints are created.
 * *   You cannot call the **CreateBasicEndpoints** operation again on the same GA instance before the previous operation is complete.
 *
 * @param request CreateBasicEndpointsRequest
 * @return CreateBasicEndpointsResponse
 */
async function createBasicEndpoints(request: CreateBasicEndpointsRequest): CreateBasicEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicEndpointsWithOptions(request, runtime);
}

model CreateBasicIpSetRequest {
  accelerateRegionId?: string(name='AccelerateRegionId', description='The ID of the acceleration region.

You can call the [ListAvailableBusiRegions](https://help.aliyun.com/document_detail/261190.html) operation to query the most recent acceleration region list.

This parameter is required.', example='cn-shanghai'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  bandwidth?: long(name='Bandwidth', description='The bandwidth that you want to allocate to the acceleration region. Unit: **Mbit/s**.

You must allocate at least 2 Mbit/s of bandwidth to the acceleration region.', example='2'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ispType?: string(name='IspType', description='The line type of the elastic IP address (EIP) in the acceleration region. Valid values:

*   **BGP** (default): BGP (Multi-ISP) lines.
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines.

Valid values if you are allowed to use single-ISP bandwidth:

*   **ChinaTelecom**
*   **ChinaUnicom**
*   **ChinaMobile**
*   **ChinaTelecom_L2**
*   **ChinaUnicom_L2**
*   **ChinaMobile_L2**

> 

*   If the bandwidth metering method of the GA instance is **pay-by-data-transfer**, this parameter is required.

*   If the acceleration region is China (Hong Kong) and a basic bandwidth plan whose bandwidth type is Premium is associated with the GA instance, the default value of IspType is BGP_PRO.

*   The supported single-ISP type varies based on the acceleration region.', example='BGP'),
  regionId?: string(name='RegionId', description='The region ID of the basic GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateBasicIpSetResponseBody = {
  ipSetId?: string(name='IpSetId', description='The region ID of the GA instance.', example='ips-bp11r5jb8ogp122xl****'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateBasicIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBasicIpSetResponseBody(name='body'),
}

/**
 * @summary Creates an acceleration region for a basic Global Accelerator (GA) instance.
 *
 * @description Take note of the following limits:
 * *   You can specify only one acceleration region for each basic GA instance, and only IPv4 clients can connect to basic GA instances.
 * *   **CreateBasicIpSet** is an asynchronous operation. After you send a request, the system returns an acceleration region ID and runs the task in the background. You can call the [GetBasicIpSet](https://help.aliyun.com/document_detail/362987.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **init** state, the acceleration region is being created. In this case, you can perform only query operations.
 *     *   If the acceleration region is in the **active** state, the acceleration region is created.
 * *   You cannot call the **CreateBasicIpSet** operation again on the same GA instance before the previous task is completed.
 *
 * @param request CreateBasicIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBasicIpSetResponse
 */
async function createBasicIpSetWithOptions(request: CreateBasicIpSetRequest, runtime: Util.RuntimeOptions): CreateBasicIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateRegionId)) {
    query['AccelerateRegionId'] = request.accelerateRegionId;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ispType)) {
    query['IspType'] = request.ispType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBasicIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an acceleration region for a basic Global Accelerator (GA) instance.
 *
 * @description Take note of the following limits:
 * *   You can specify only one acceleration region for each basic GA instance, and only IPv4 clients can connect to basic GA instances.
 * *   **CreateBasicIpSet** is an asynchronous operation. After you send a request, the system returns an acceleration region ID and runs the task in the background. You can call the [GetBasicIpSet](https://help.aliyun.com/document_detail/362987.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **init** state, the acceleration region is being created. In this case, you can perform only query operations.
 *     *   If the acceleration region is in the **active** state, the acceleration region is created.
 * *   You cannot call the **CreateBasicIpSet** operation again on the same GA instance before the previous task is completed.
 *
 * @param request CreateBasicIpSetRequest
 * @return CreateBasicIpSetResponse
 */
async function createBasicIpSet(request: CreateBasicIpSetRequest): CreateBasicIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBasicIpSetWithOptions(request, runtime);
}

model CreateCustomRoutingEndpointGroupDestinationsRequest {
  clientToken?: string(name='ClientToken', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationConfigurations?: [ 
    {
      fromPort?: int32(name='FromPort', description='The last port of the backend service port range.

Valid values: **1** to **65499**. The value of **FromPort** must be equal to or smaller than the value of **ToPort**.

You can specify up to 20 last ports in each call.

This parameter is required.', example='80'),
      protocols?: [ string ](name='Protocols', description='The backend service protocol of the endpoint group. Valid values:

*   **TCP**
*   **UDP**
*   **TCP+UDP: the TCP and UDP protocols.**

You can specify up to four backend service protocols for each endpoint group mapping.

This parameter is required.'),
      toPort?: int32(name='ToPort', description='The response parameters.

This parameter is required.', example='80'),
    }
  ](name='DestinationConfigurations', description='The mapping configuration of the endpoint group.

You need to specify the backend service ports and protocols for the endpoint group. The ports are mapped to listener ports.

You can specify up to 20 mappings in each call.

This parameter is required.'),
  dryRun?: boolean(name='DryRun', description='The endpoint group ID.', example='false'),
  endpointGroupId?: string(name='EndpointGroupId', description='The mappings of the endpoint group.

You need to specify the backend service ports and protocols for the endpoint group. The ports are mapped to listener ports.

You can specify up to 20 mappings in each call.

This parameter is required.', example='epg-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.

This parameter is required.', example='cn-hangzhou'),
}

model CreateCustomRoutingEndpointGroupDestinationsResponseBody = {
  destinationIds?: [ string ](name='DestinationIds', description='The IDs of the endpoint group mappings.'),
  requestId?: string(name='RequestId', description='The IDs of the endpoint group mappings.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateCustomRoutingEndpointGroupDestinationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomRoutingEndpointGroupDestinationsResponseBody(name='body'),
}

/**
 * @summary After you configure a custom routing listener for a Global Accelerator (GA) instance, the GA instance generates a port mapping table based on the listener port range, mapping information (protocols and port ranges) of the associated endpoint groups, and IP addresses of endpoints (vSwitches), and forwards client requests to the specified IP addresses and ports in the vSwitches.
 * You can call this operation to create mappings for an endpoint group of a custom routing listener. Take note of the following items:
 * *   **CreateCustomRoutingEndpointGroupDestinations** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, it indicates that the mappings are being created for the endpoint group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the mappings are created for the endpoint group.
 * *   You cannot call the **CreateCustomRoutingEndpointGroupDestinations** operation again on the same GA instance before the previous task is completed.
 * ### Prerequisites
 * Make sure that the following prerequisites are met before you call this operation:
 * *   A standard GA instance is created. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   A bandwidth plan is associated with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   An application is deployed as an endpoint to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   The permissions to use custom routing listeners are acquired and a custom routing listener is created for the GA instance. The custom routing listener feature is in invitational preview. To use the feature, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.11182188.console-base-top.dworkorder.18ae4882n3v6ZW#/ticket/createIndex). For information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 * *   An endpoint group is created for the custom routing listener. For more information, see [CreateCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449363.html).
 *
 * @description readAndWrite
 *
 * @param request CreateCustomRoutingEndpointGroupDestinationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomRoutingEndpointGroupDestinationsResponse
 */
async function createCustomRoutingEndpointGroupDestinationsWithOptions(request: CreateCustomRoutingEndpointGroupDestinationsRequest, runtime: Util.RuntimeOptions): CreateCustomRoutingEndpointGroupDestinationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationConfigurations)) {
    query['DestinationConfigurations'] = request.destinationConfigurations;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomRoutingEndpointGroupDestinations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary After you configure a custom routing listener for a Global Accelerator (GA) instance, the GA instance generates a port mapping table based on the listener port range, mapping information (protocols and port ranges) of the associated endpoint groups, and IP addresses of endpoints (vSwitches), and forwards client requests to the specified IP addresses and ports in the vSwitches.
 * You can call this operation to create mappings for an endpoint group of a custom routing listener. Take note of the following items:
 * *   **CreateCustomRoutingEndpointGroupDestinations** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, it indicates that the mappings are being created for the endpoint group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the mappings are created for the endpoint group.
 * *   You cannot call the **CreateCustomRoutingEndpointGroupDestinations** operation again on the same GA instance before the previous task is completed.
 * ### Prerequisites
 * Make sure that the following prerequisites are met before you call this operation:
 * *   A standard GA instance is created. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   A bandwidth plan is associated with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   An application is deployed as an endpoint to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   The permissions to use custom routing listeners are acquired and a custom routing listener is created for the GA instance. The custom routing listener feature is in invitational preview. To use the feature, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.11182188.console-base-top.dworkorder.18ae4882n3v6ZW#/ticket/createIndex). For information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 * *   An endpoint group is created for the custom routing listener. For more information, see [CreateCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449363.html).
 *
 * @description readAndWrite
 *
 * @param request CreateCustomRoutingEndpointGroupDestinationsRequest
 * @return CreateCustomRoutingEndpointGroupDestinationsResponse
 */
async function createCustomRoutingEndpointGroupDestinations(request: CreateCustomRoutingEndpointGroupDestinationsRequest): CreateCustomRoutingEndpointGroupDestinationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomRoutingEndpointGroupDestinationsWithOptions(request, runtime);
}

model CreateCustomRoutingEndpointGroupsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** for each API request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  endpointGroupConfigurations?: [ 
    {
      description?: string(name='Description', description='The description of the endpoint group.

The description cannot exceed 256 characters in length and cannot contain `http://` or `https://`.

You can specify at most five endpoint group descriptions.', example='test'),
      destinationConfigurations?: [ 
        {
          fromPort?: int32(name='FromPort', description='The first backend service port for the endpoint group.

Valid values: **1** to **65499**. The value of **FromPort** must be smaller than or equal to the value of **ToPort**.

You can specify at most 20 first backend service ports for each endpoint group.', example='80'),
          protocols?: [ string ](name='Protocols', description='The backend service protocol.

You can specify up to four backend service protocols in each mapping configuration.'),
          toPort?: int32(name='ToPort', description='The last backend service port for the endpoint group.

Valid values: **1** to **65499**. The value of **FromPort** must be smaller than or equal to the value of **ToPort**.

You can specify at most 20 last backend service ports for each endpoint group.', example='80'),
        }
      ](name='DestinationConfigurations', description='The mapping configuration of the endpoint group.

You need to specify the backend service ports and protocols for the endpoint group. The ports are mapped to listener ports.

You can specify at most 20 mapping configurations for each endpoint group.'),
      endpointConfigurations?: [ 
        {
          endpoint?: string(name='Endpoint', description='The name of the vSwitch that is specified as an endpoint.', example='vsw-test01'),
          policyConfigurations?: [ 
            {
              address?: string(name='Address', description='The IP address of the destination to which traffic is forwarded.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify at most 20 destination IP addresses for each endpoint.', example='10.0.XX.XX'),
              portRanges?: [ 
                {
                  fromPort?: int32(name='FromPort', description='The first port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for at most 20 destinations in each endpoint and specify at most five first ports for each destination.', example='80'),
                  toPort?: int32(name='ToPort', description='The last port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for at most 20 destinations in each endpoint and specify at most five last ports for each destination.', example='80'),
                }
              ](name='PortRanges', description='The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you leave this parameter empty, traffic is forwarded to all destination ports.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for at most 20 destinations in each endpoint and specify at most five port ranges for each destination.'),
            }
          ](name='PolicyConfigurations', description='The destination to which traffic is forwarded.

You can specify at most 20 destinations for each endpoint.'),
          trafficToEndpointPolicy?: string(name='TrafficToEndpointPolicy', description='The traffic policy that is used to process traffic to the endpoint. Valid values:

*   **AllowAll**: allows all traffic to the endpoint.
*   **DenyAll** (default): denies all traffic to the endpoint.
*   **AllowCustom**: allows traffic only to specified destinations in the endpoint.

If you set this parameter to AllowCustom, you must specify IP addresses and port ranges as the destinations to which traffic is distributed. If you specify only IP addresses and do not specify port ranges, GA can forward traffic to the specified IP addresses over all destination ports.', example='DenyAll'),
          type?: string(name='Type', description='The type of endpoint.

Set the value to **PrivateSubNet**, which specifies a private CIDR block. This is the default value.', example='PrivateSubNet'),
        }
      ](name='EndpointConfigurations', description='The information about the endpoints.

You can specify at most 10 endpoints for each endpoint group.'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region in which the endpoint group resides.

You can specify at most five region IDs.

This parameter is required.', example='cn-hangzhou'),
      name?: string(name='Name', description='The name of the endpoint group.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

You can specify at most five endpoint group names.', example='test'),
    }
  ](name='EndpointGroupConfigurations', description='The information about the endpoint groups.

You can specify at most five endpoint groups.

This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The ID of the custom routing listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateCustomRoutingEndpointGroupsResponseBody = {
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of the endpoint groups.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateCustomRoutingEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomRoutingEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Creates endpoint groups for a custom routing listener.
 *
 * @description Global Accelerator (GA) forwards client requests to endpoints in an endpoint group based on the routing type of the listener that is associated with the endpoint group.
 * *   After you configure an intelligent routing listener for a GA instance, the GA instance selects a nearby and healthy endpoint group and forwards client requests to a healthy endpoint in the endpoint group.
 * *   After you configure a custom routing listener for a GA instance, the instance generates a port mapping table based on the listener port range, protocols and port ranges of the associated endpoint groups, and IP addresses of endpoints (vSwitches), and forwards client requests to specified IP addresses and ports in the vSwitches.
 * You can call this operation to create endpoint groups for custom routing listeners. For information about how to create endpoint groups for intelligent routing listeners, see [CreateEndpointGroup](https://help.aliyun.com/document_detail/153259.html).
 * When you call this operation, take note of the following items:
 * *   **CreateCustomRoutingEndpointGroups** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) or [ListCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449374.html) operation to query the status of the endpoint groups that are associated with custom routing listeners.
 *     *   If one or more endpoint groups are in the **init** state, it indicates that the endpoint groups are being created. In this case, you can perform only query operations.
 *     *   If all endpoint groups are in the **active** state, it indicates that the endpoint groups are created.
 * *   The **CreateCustomRoutingEndpointGroups** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 * ### Prerequisites
 * Make sure that the following requirements are met before you call this operation:
 * *   A standard GA instance is created. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   A bandwidth plan is associated with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   An application is deployed to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   The permissions to use custom routing listeners are acquired and a custom routing listener is created for the GA instance. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 *
 * @param request CreateCustomRoutingEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomRoutingEndpointGroupsResponse
 */
async function createCustomRoutingEndpointGroupsWithOptions(request: CreateCustomRoutingEndpointGroupsRequest, runtime: Util.RuntimeOptions): CreateCustomRoutingEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupConfigurations)) {
    query['EndpointGroupConfigurations'] = request.endpointGroupConfigurations;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomRoutingEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates endpoint groups for a custom routing listener.
 *
 * @description Global Accelerator (GA) forwards client requests to endpoints in an endpoint group based on the routing type of the listener that is associated with the endpoint group.
 * *   After you configure an intelligent routing listener for a GA instance, the GA instance selects a nearby and healthy endpoint group and forwards client requests to a healthy endpoint in the endpoint group.
 * *   After you configure a custom routing listener for a GA instance, the instance generates a port mapping table based on the listener port range, protocols and port ranges of the associated endpoint groups, and IP addresses of endpoints (vSwitches), and forwards client requests to specified IP addresses and ports in the vSwitches.
 * You can call this operation to create endpoint groups for custom routing listeners. For information about how to create endpoint groups for intelligent routing listeners, see [CreateEndpointGroup](https://help.aliyun.com/document_detail/153259.html).
 * When you call this operation, take note of the following items:
 * *   **CreateCustomRoutingEndpointGroups** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) or [ListCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449374.html) operation to query the status of the endpoint groups that are associated with custom routing listeners.
 *     *   If one or more endpoint groups are in the **init** state, it indicates that the endpoint groups are being created. In this case, you can perform only query operations.
 *     *   If all endpoint groups are in the **active** state, it indicates that the endpoint groups are created.
 * *   The **CreateCustomRoutingEndpointGroups** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 * ### Prerequisites
 * Make sure that the following requirements are met before you call this operation:
 * *   A standard GA instance is created. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   A bandwidth plan is associated with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   An application is deployed to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   The permissions to use custom routing listeners are acquired and a custom routing listener is created for the GA instance. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 *
 * @param request CreateCustomRoutingEndpointGroupsRequest
 * @return CreateCustomRoutingEndpointGroupsResponse
 */
async function createCustomRoutingEndpointGroups(request: CreateCustomRoutingEndpointGroupsRequest): CreateCustomRoutingEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomRoutingEndpointGroupsWithOptions(request, runtime);
}

model CreateCustomRoutingEndpointTrafficPoliciesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** for each API request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint for which you want to create traffic destinations.

This parameter is required.', example='ep-2zewuzypq5e6r3pfh****'),
  policyConfigurations?: [ 
    {
      address?: string(name='Address', description='The IP address of the destination to which traffic is forwarded.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify up to 500 destination IP addresses for each endpoint.

> This parameter is required.', example='10.0.XX.XX'),
      portRanges?: [ 
        {
          fromPort?: int32(name='FromPort', description='The first port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

If the first port and the last port are not specified, traffic on all ports of the destination is allowed.

You can specify port ranges for up to 500 destinations in each endpoint and specify up to 10 first ports for each destination.', example='80'),
          toPort?: int32(name='ToPort', description='The last port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

If the first port and the last port are not specified, traffic on all ports of the destination is allowed.

You can specify port ranges for up to 500 destinations in each endpoint and specify up to 10 last ports for each destination.', example='80'),
        }
      ](name='PortRanges', description='The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you leave this parameter empty, traffic is forwarded to all destination ports.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 500 traffic destinations in each endpoint and specify up to 10 port ranges for each traffic destination.'),
    }
  ](name='PolicyConfigurations', description='The configurations of the traffic destinations.

You can specify up to 500 traffic destinations for each endpoint.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateCustomRoutingEndpointTrafficPoliciesResponseBody = {
  policyIds?: [ string ](name='PolicyIds', description='The IDs of the traffic destinations.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateCustomRoutingEndpointTrafficPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomRoutingEndpointTrafficPoliciesResponseBody(name='body'),
}

/**
 * @summary Creates traffic destinations for an endpoint that is associated with a custom routing listener.
 *
 * @description This operation takes effect only when the traffic access policy of an endpoint allows traffic to specified destinations. You can call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation to query the traffic access policy of an endpoint. This operation takes effect only if the value of **TrafficToEndpointPolicy** is set to **AllowCustom**, which allows traffic to specific destinations.
 * When you call this operation, take note of the following items:
 * *   **CreateCustomRoutingEndpointTrafficPolicies** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, the traffic destinations are being created. In this state, you can only query the traffic destinations.
 *     *   If the endpoint group is in the **active** state, the traffic destinations are created.
 * *   You cannot call the **CreateCustomRoutingEndpointTrafficPolicies** operation repeatedly for the same GA instance in a specific period of time.
 * ### [](#)Prerequisites
 * Before you call this operation, make sure that the following requirements are met:
 * *   A standard GA instance is created. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   If the bandwidth metering method of the standard GA instance is **pay-by-bandwidth**, a bandwidth plan must be associated with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   An application that serves as the endpoint of the standard GA instance is deployed to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   The permissions to use custom routing listeners are acquired, and a custom routing listener is created. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 * *   Endpoint groups are created for the custom routing listener. For more information, see [CreateCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449363.html).
 * *   Endpoints are created for the custom routing listener. For more information, see [CreateCustomRoutingEndpoints](https://help.aliyun.com/document_detail/449382.html).
 *
 * @param request CreateCustomRoutingEndpointTrafficPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomRoutingEndpointTrafficPoliciesResponse
 */
async function createCustomRoutingEndpointTrafficPoliciesWithOptions(request: CreateCustomRoutingEndpointTrafficPoliciesRequest, runtime: Util.RuntimeOptions): CreateCustomRoutingEndpointTrafficPoliciesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.policyConfigurations)) {
    query['PolicyConfigurations'] = request.policyConfigurations;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomRoutingEndpointTrafficPolicies',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates traffic destinations for an endpoint that is associated with a custom routing listener.
 *
 * @description This operation takes effect only when the traffic access policy of an endpoint allows traffic to specified destinations. You can call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation to query the traffic access policy of an endpoint. This operation takes effect only if the value of **TrafficToEndpointPolicy** is set to **AllowCustom**, which allows traffic to specific destinations.
 * When you call this operation, take note of the following items:
 * *   **CreateCustomRoutingEndpointTrafficPolicies** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, the traffic destinations are being created. In this state, you can only query the traffic destinations.
 *     *   If the endpoint group is in the **active** state, the traffic destinations are created.
 * *   You cannot call the **CreateCustomRoutingEndpointTrafficPolicies** operation repeatedly for the same GA instance in a specific period of time.
 * ### [](#)Prerequisites
 * Before you call this operation, make sure that the following requirements are met:
 * *   A standard GA instance is created. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   If the bandwidth metering method of the standard GA instance is **pay-by-bandwidth**, a bandwidth plan must be associated with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   An application that serves as the endpoint of the standard GA instance is deployed to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   The permissions to use custom routing listeners are acquired, and a custom routing listener is created. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 * *   Endpoint groups are created for the custom routing listener. For more information, see [CreateCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449363.html).
 * *   Endpoints are created for the custom routing listener. For more information, see [CreateCustomRoutingEndpoints](https://help.aliyun.com/document_detail/449382.html).
 *
 * @param request CreateCustomRoutingEndpointTrafficPoliciesRequest
 * @return CreateCustomRoutingEndpointTrafficPoliciesResponse
 */
async function createCustomRoutingEndpointTrafficPolicies(request: CreateCustomRoutingEndpointTrafficPoliciesRequest): CreateCustomRoutingEndpointTrafficPoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomRoutingEndpointTrafficPoliciesWithOptions(request, runtime);
}

model CreateCustomRoutingEndpointsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** for each API request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointConfigurations?: [ 
    {
      endpoint?: string(name='Endpoint', description='The ID of the vSwitch that is specified as an endpoint.', example='vsw-test01'),
      policyConfigurations?: [ 
        {
          address?: string(name='Address', description='The IP address of the destination to which traffic is forwarded.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify up to 20 destination IP addresses for each endpoint.

This parameter is required.', example='10.0.XX.XX'),
          portRanges?: [ 
            {
              fromPort?: int32(name='FromPort', description='The first port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 first ports for each destination.', example='80'),
              toPort?: int32(name='ToPort', description='The last port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 last ports for each destination.', example='80'),
            }
          ](name='PortRanges', description='The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you leave this parameter empty, traffic is forwarded to all destination ports.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 port ranges for each destination.'),
        }
      ](name='PolicyConfigurations', description='The destination to which traffic is forwarded.

You can specify up to 20 destinations for each endpoint.'),
      trafficToEndpointPolicy?: string(name='TrafficToEndpointPolicy', description='The traffic policy that is used to process traffic to the endpoint. Valid values:

*   **DenyAll** (default): denies all traffic to the endpoint.
*   **AllowAll**: allows all traffic to the endpoint.
*   **AllowCustom**: allows traffic only to specified destinations in the endpoint.

If you set this parameter to AllowCustom, you must specify IP addresses and port ranges as the destinations to which traffic is distributed. If you specify only IP addresses and do not specify port ranges, GA can forward traffic to the specified IP addresses over all destination ports.', example='DenyAll'),
      type?: string(name='Type', description='The type of endpoint.

Set the value to **PrivateSubNet**, which specifies a private CIDR block. This is the default value.', example='PrivateSubNet'),
    }
  ](name='EndpointConfigurations', description='The information about the endpoints.

You can specify information for up to 20 endpoints.

This parameter is required.'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group in which to create endpoints.

This parameter is required.', example='epg-bp1bpn0kn908w4nb****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateCustomRoutingEndpointsResponseBody = {
  endpointIds?: [ string ](name='EndpointIds', description='The IDs of the endpoints.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateCustomRoutingEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomRoutingEndpointsResponseBody(name='body'),
}

/**
 * @summary Creates endpoints for a custom routing listener.
 *
 * @description After you configure a custom routing listener for a Global Accelerator (GA) instance, the instance generates a port mapping table based on the listener port range, the protocols and port ranges of the associated endpoint groups, and the IP addresses of endpoints (vSwitches), and forwards client requests to specified IP addresses and ports in the vSwitches.
 * This operation is used to create endpoints for custom routing listeners. When you call this operation, take note of the following items:
 * *   **CreateCustomRoutingEndpoints** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of an endpoint group and determine whether endpoints are created in the endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that endpoints are being created. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that endpoints are created.
 * *   The **CreateCustomRoutingEndpoints** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 * ### Prerequisites
 * The following operations are complete before you call this operation:
 * *   Create a standard GA instance. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   Associate a bandwidth plan with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   Deploy an application that serves as the endpoint of the GA instance. The application is used to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   Apply for permissions to use custom routing listeners and create a custom routing listener for the standard GA instance. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 * *   Create an endpoint group for the custom routing listener. For more information, see [CreateCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449363.html).
 *
 * @param request CreateCustomRoutingEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomRoutingEndpointsResponse
 */
async function createCustomRoutingEndpointsWithOptions(request: CreateCustomRoutingEndpointsRequest, runtime: Util.RuntimeOptions): CreateCustomRoutingEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointConfigurations)) {
    query['EndpointConfigurations'] = request.endpointConfigurations;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomRoutingEndpoints',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates endpoints for a custom routing listener.
 *
 * @description After you configure a custom routing listener for a Global Accelerator (GA) instance, the instance generates a port mapping table based on the listener port range, the protocols and port ranges of the associated endpoint groups, and the IP addresses of endpoints (vSwitches), and forwards client requests to specified IP addresses and ports in the vSwitches.
 * This operation is used to create endpoints for custom routing listeners. When you call this operation, take note of the following items:
 * *   **CreateCustomRoutingEndpoints** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of an endpoint group and determine whether endpoints are created in the endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that endpoints are being created. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that endpoints are created.
 * *   The **CreateCustomRoutingEndpoints** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 * ### Prerequisites
 * The following operations are complete before you call this operation:
 * *   Create a standard GA instance. For more information, see [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html).
 * *   Associate a bandwidth plan with the standard GA instance. For more information, see [BandwidthPackageAddAccelerator](https://help.aliyun.com/document_detail/153239.html).
 * *   Deploy an application that serves as the endpoint of the GA instance. The application is used to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
 * *   Apply for permissions to use custom routing listeners and create a custom routing listener for the standard GA instance. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see [CreateListener](https://help.aliyun.com/document_detail/153253.html).
 * *   Create an endpoint group for the custom routing listener. For more information, see [CreateCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/449363.html).
 *
 * @param request CreateCustomRoutingEndpointsRequest
 * @return CreateCustomRoutingEndpointsResponse
 */
async function createCustomRoutingEndpoints(request: CreateCustomRoutingEndpointsRequest): CreateCustomRoutingEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomRoutingEndpointsWithOptions(request, runtime);
}

model CreateDomainRequest {
  acceleratorIds?: [ string ](name='AcceleratorIds', description='The ID of the GA instance.

You can enter up to 50 IDs.

This parameter is required.'),
  domain?: string(name='Domain', description='The accelerated domain name to be added.

Wildcard domain names are supported. A wildcard domain name must start with `*.`, such as `*.example.com`.

This parameter is required.', example='www.example.com'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model CreateDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDomainResponseBody(name='body'),
}

/**
 * @summary Creates a domain name and associates it with Global Accelerator (GA) instances.
 *
 * @description After you associate an accelerated domain name that has obtained an ICP number with a Global Accelerator (GA) instance, you do not need to complete filing for the accelerated domain name or its subdomains on Alibaba Cloud.
 * You can call this operation to add an accelerated domain name and associate the accelerated domain name with GA instances. When you call this operation, take note of the following items:
 * *   If your accelerated domain name is hosted in the Chinese mainland, you must obtain an ICP number for the domain name.
 * *   The same accelerated domain name cannot be repeatedly associated with the same GA instance.
 * *   You cannot repeatedly call the **CreateDomain** operation by using the same Alibaba Cloud account within a specific period of time.
 *
 * @param request CreateDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDomainResponse
 */
async function createDomainWithOptions(request: CreateDomainRequest, runtime: Util.RuntimeOptions): CreateDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorIds)) {
    query['AcceleratorIds'] = request.acceleratorIds;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDomain',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a domain name and associates it with Global Accelerator (GA) instances.
 *
 * @description After you associate an accelerated domain name that has obtained an ICP number with a Global Accelerator (GA) instance, you do not need to complete filing for the accelerated domain name or its subdomains on Alibaba Cloud.
 * You can call this operation to add an accelerated domain name and associate the accelerated domain name with GA instances. When you call this operation, take note of the following items:
 * *   If your accelerated domain name is hosted in the Chinese mainland, you must obtain an ICP number for the domain name.
 * *   The same accelerated domain name cannot be repeatedly associated with the same GA instance.
 * *   You cannot repeatedly call the **CreateDomain** operation by using the same Alibaba Cloud account within a specific period of time.
 *
 * @param request CreateDomainRequest
 * @return CreateDomainResponse
 */
async function createDomain(request: CreateDomainRequest): CreateDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDomainWithOptions(request, runtime);
}

model CreateEndpointGroupRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the endpoint group.

The description can be up to 200 characters in length and cannot start with `http://` or `https://`.', example='EndpointGroup'),
  endpointConfigurations?: [ 
    {
      enableClientIPPreservation?: boolean(name='EnableClientIPPreservation', description='Specifies whether to preserve client IP addresses by using the TCP Option Address (TOA) module. Valid values:

*   **true**
*   **false** (default)', example='false'),
      enableProxyProtocol?: boolean(name='EnableProxyProtocol', description='Specifies whether to use the proxy protocol to preserve client IP addresses. Valid values:

*   **true**
*   **false** (default)', example='false'),
      endpoint?: string(name='Endpoint', description='Enter the IP address, domain name, or instance ID based on the value of the Type parameter.

This parameter is required.', example='120.1.XX.XX'),
      subAddress?: string(name='SubAddress', description='The private IP address of the ENI.

>  This parameter is available only when you set the endpoint type to **ENI**. If you leave this parameter empty, the primary private IP address of the ENI is used.', example='172.168.XX.XX'),
      type?: string(name='Type', description='The type of the endpoint. Valid values:

*   **Domain:** a custom domain name.
*   **Ip:** a custom IP address.
*   **PublicIp:** a public IP address provided by Alibaba Cloud.
*   **ECS:** an Elastic Compute Service (ECS) instance.
*   **SLB:** a Classic Load Balancer (CLB) instance.
*   **ALB:** an Application Load Balancer (ALB) instance.
*   **OSS:** an Object Storage Service (OSS) bucket.
*   **ENI:** an elastic network interface (ENI).
*   **NLB:** a Network Load Balancer (NLB) instance.

> 

*   If you set this parameter to **ECS**, **ENI**, **SLB**, **ALB**, or **NLB** and the AliyunServiceRoleForGaVpcEndpoint service-linked role does not exist, the system automatically creates the service-linked role.

*   If you set this parameter to **ALB** and the AliyunServiceRoleForGaAlb service-linked role does not exist, the system automatically creates the role.

*   If you set this parameter to **OSS** and the AliyunServiceRoleForGaOss service-linked role does not exist, the system automatically creates the role.

*   If you set this parameter to **NLB** and the AliyunServiceRoleForGaNlb service-linked role does not exist, the system automatically creates the role.

For more information, see [Service-linked roles](https://help.aliyun.com/document_detail/178360.html).

This parameter is required.', example='Ip'),
      weight?: int32(name='Weight', description='The weight of the endpoint.

Valid values: **0** to **255**.

>  If you set the weight of an endpoint to 0, GA stops distributing traffic to the endpoint. Proceed with caution.

This parameter is required.', example='20'),
    }
  ](name='EndpointConfigurations', description='The configurations of endpoints in the endpoint group.'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region in which to create the endpoint group.

This parameter is required.', example='cn-hangzhou'),
  endpointGroupType?: string(name='EndpointGroupType', description='The type of the endpoint group. Valid values:

*   **default** (default): a default endpoint group.
*   **virtual**: a virtual endpoint group.

>  When you call this operation to create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created.', example='default'),
  endpointProtocolVersion?: string(name='EndpointProtocolVersion', description='The version of the protocol that is used by the backend service. Valid values:

- **HTTP1.1** (default)
- **HTTP2**

>  This parameter is required only when you set the **EndpointRequestProtocol** parameter to **HTTPS**.'),
  endpointRequestProtocol?: string(name='EndpointRequestProtocol', description='The protocol that is used by the backend service. Default value: HTTP. Valid values:

*   **HTTP**
*   **HTTPS**

> *   You can set this parameter only when the listener that is associated with the endpoint group uses **HTTP** or **HTTPS**.
>*   For an **HTTP** listener, the backend service protocol must be **HTTP**.', example='HTTP'),
  healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable the health check feature. Valid values:

*   **true**
*   **false**', example='true'),
  healthCheckIntervalSeconds?: int32(name='HealthCheckIntervalSeconds', description='The interval at which health checks are performed. Unit: seconds.', example='3'),
  healthCheckPath?: string(name='HealthCheckPath', description='The path to which to send health check requests.', example='/healthcheck'),
  healthCheckPort?: int32(name='HealthCheckPort', description='The port that is used for health checks.', example='20'),
  healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol over which to send health check requests. Valid values:

*   **tcp** or **TCP**
*   **http** or **HTTP**
*   **https** or **HTTPS**', example='tcp'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  name?: string(name='Name', description='The name of the endpoint group.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='group1'),
  portOverrides?: [ 
    {
      endpointPort?: int32(name='EndpointPort', description='The endpoint port that is mapped to the listener port.', example='80'),
      listenerPort?: int32(name='ListenerPort', description='The listener port that is mapped to the endpoint port.

> *   Only HTTP and HTTPS listeners support port mappings.
>*   The listener port must be the one used by the current listener.', example='443'),
    }
  ](name='PortOverrides', description='The mappings between ports.'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the GA instance. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='test-key'),
      value?: string(name='Value', description='The tag value of the GA instance. The tag value cannot be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='test-value'),
    }
  ](name='Tag', description='Tags of GA instances.'),
  thresholdCount?: int32(name='ThresholdCount', description='The number of consecutive health check failures that must occur before a healthy endpoint group is considered unhealthy, or the number of consecutive health check successes that must occur before an unhealthy endpoint group is considered healthy.

Valid values: **2** to **10**. Default value: **3**.', example='3'),
  trafficPercentage?: int32(name='TrafficPercentage', description='The traffic ratio for the endpoint group when the specified listener is associated with multiple endpoint groups.

Valid values: **1** to **100**.', example='20'),
}

model CreateEndpointGroupResponseBody = {
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp1dmlohjjz4kqaun****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Creates an endpoint group.
 *
 * @description *   When you call this operation to create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created.
 * *   **CreateEndpointGroup** is an asynchronous operation. After you send a request, the system returns the ID of an endpoint group, but the endpoint group is still being created in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of the endpoint group.
 *     *   If the endpoint group is in the **init** state, it indicates that the endpoint group is being created. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the endpoint group is created.
 * *   The **CreateEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request CreateEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEndpointGroupResponse
 */
async function createEndpointGroupWithOptions(request: CreateEndpointGroupRequest, runtime: Util.RuntimeOptions): CreateEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointConfigurations)) {
    query['EndpointConfigurations'] = request.endpointConfigurations;
  }
  if (!Util.isUnset(request.endpointGroupRegion)) {
    query['EndpointGroupRegion'] = request.endpointGroupRegion;
  }
  if (!Util.isUnset(request.endpointGroupType)) {
    query['EndpointGroupType'] = request.endpointGroupType;
  }
  if (!Util.isUnset(request.endpointProtocolVersion)) {
    query['EndpointProtocolVersion'] = request.endpointProtocolVersion;
  }
  if (!Util.isUnset(request.endpointRequestProtocol)) {
    query['EndpointRequestProtocol'] = request.endpointRequestProtocol;
  }
  if (!Util.isUnset(request.healthCheckEnabled)) {
    query['HealthCheckEnabled'] = request.healthCheckEnabled;
  }
  if (!Util.isUnset(request.healthCheckIntervalSeconds)) {
    query['HealthCheckIntervalSeconds'] = request.healthCheckIntervalSeconds;
  }
  if (!Util.isUnset(request.healthCheckPath)) {
    query['HealthCheckPath'] = request.healthCheckPath;
  }
  if (!Util.isUnset(request.healthCheckPort)) {
    query['HealthCheckPort'] = request.healthCheckPort;
  }
  if (!Util.isUnset(request.healthCheckProtocol)) {
    query['HealthCheckProtocol'] = request.healthCheckProtocol;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.portOverrides)) {
    query['PortOverrides'] = request.portOverrides;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.thresholdCount)) {
    query['ThresholdCount'] = request.thresholdCount;
  }
  if (!Util.isUnset(request.trafficPercentage)) {
    query['TrafficPercentage'] = request.trafficPercentage;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an endpoint group.
 *
 * @description *   When you call this operation to create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created.
 * *   **CreateEndpointGroup** is an asynchronous operation. After you send a request, the system returns the ID of an endpoint group, but the endpoint group is still being created in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of the endpoint group.
 *     *   If the endpoint group is in the **init** state, it indicates that the endpoint group is being created. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the endpoint group is created.
 * *   The **CreateEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request CreateEndpointGroupRequest
 * @return CreateEndpointGroupResponse
 */
async function createEndpointGroup(request: CreateEndpointGroupRequest): CreateEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createEndpointGroupWithOptions(request, runtime);
}

model CreateEndpointGroupsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  endpointGroupConfigurations?: [ 
    {
      enableClientIPPreservationProxyProtocol?: boolean(name='EnableClientIPPreservationProxyProtocol'),
      enableClientIPPreservationToa?: boolean(name='EnableClientIPPreservationToa'),
      endpointConfigurations?: [ 
        {
          endpoint?: string(name='Endpoint'),
          subAddress?: string(name='SubAddress'),
          type?: string(name='Type'),
          weight?: long(name='Weight'),
        }
      ](name='EndpointConfigurations'),
      endpointGroupDescription?: string(name='EndpointGroupDescription'),
      endpointGroupName?: string(name='EndpointGroupName'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='This parameter is required.'),
      endpointGroupType?: string(name='EndpointGroupType'),
      endpointProtocolVersion?: string(name='EndpointProtocolVersion'),
      endpointRequestProtocol?: string(name='EndpointRequestProtocol'),
      healthCheckEnabled?: boolean(name='HealthCheckEnabled'),
      healthCheckIntervalSeconds?: long(name='HealthCheckIntervalSeconds'),
      healthCheckPath?: string(name='HealthCheckPath'),
      healthCheckPort?: long(name='HealthCheckPort'),
      healthCheckProtocol?: string(name='HealthCheckProtocol'),
      portOverrides?: [ 
        {
          endpointPort?: long(name='EndpointPort'),
          listenerPort?: long(name='ListenerPort'),
        }
      ](name='PortOverrides'),
      systemTag?: [ 
        {
          key?: string(name='Key'),
          scope?: string(name='Scope'),
          value?: string(name='Value'),
        }
      ](name='SystemTag'),
      tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag'),
      thresholdCount?: long(name='ThresholdCount'),
      trafficPercentage?: long(name='TrafficPercentage'),
    }
  ](name='EndpointGroupConfigurations', description='This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

>  If the listener protocol is **HTTP** or **HTTPS**, you can call the **CreateEndpointGroups** operation to create only one endpoint group.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateEndpointGroupsResponseBody = {
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of the endpoint groups.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model CreateEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Creates endpoint groups.
 *
 * @description *   **CreateEndpointGroups** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) or [ListEndpointGroups](https://help.aliyun.com/document_detail/153261.html) operation to query the status of the task:
 *     *   If the endpoint groups are in the **init** state, the endpoint groups are being created. In this case, you can perform only query operations.
 *     *   If all endpoint groups are in the **active** state, the endpoint groups are created.
 * *   The **CreateEndpointGroups** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request CreateEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEndpointGroupsResponse
 */
async function createEndpointGroupsWithOptions(request: CreateEndpointGroupsRequest, runtime: Util.RuntimeOptions): CreateEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.endpointGroupConfigurations)) {
    bodyFlat['EndpointGroupConfigurations'] = request.endpointGroupConfigurations;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates endpoint groups.
 *
 * @description *   **CreateEndpointGroups** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) or [ListEndpointGroups](https://help.aliyun.com/document_detail/153261.html) operation to query the status of the task:
 *     *   If the endpoint groups are in the **init** state, the endpoint groups are being created. In this case, you can perform only query operations.
 *     *   If all endpoint groups are in the **active** state, the endpoint groups are created.
 * *   The **CreateEndpointGroups** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request CreateEndpointGroupsRequest
 * @return CreateEndpointGroupsResponse
 */
async function createEndpointGroups(request: CreateEndpointGroupsRequest): CreateEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createEndpointGroupsWithOptions(request, runtime);
}

model CreateForwardingRulesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4q****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** may be different for each API request.', example='02fb3da4****'),
  forwardingRules?: [ 
    {
      forwardingRuleName?: string(name='ForwardingRuleName'),
      priority?: int32(name='Priority'),
      ruleActions?: [ 
        {
          forwardGroupConfig?: {
            serverGroupTuples?: [ 
              {
                endpointGroupId?: string(name='EndpointGroupId', description='This parameter is required.'),
              }
            ](name='ServerGroupTuples', description='This parameter is required.'),
          }(name='ForwardGroupConfig'),
          order?: int32(name='Order', description='This parameter is required.'),
          ruleActionType?: string(name='RuleActionType', description='This parameter is required.'),
          ruleActionValue?: string(name='RuleActionValue'),
        }
      ](name='RuleActions', description='This parameter is required.'),
      ruleConditions?: [ 
        {
          hostConfig?: {
            values?: [ string ](name='Values'),
          }(name='HostConfig'),
          pathConfig?: {
            values?: [ string ](name='Values'),
          }(name='PathConfig'),
          ruleConditionType?: string(name='RuleConditionType'),
          ruleConditionValue?: string(name='RuleConditionValue'),
        }
      ](name='RuleConditions', description='This parameter is required.'),
      ruleDirection?: string(name='RuleDirection'),
    }
  ](name='ForwardingRules', description='This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1s0vzbi5bxlx5****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateForwardingRulesResponseBody = {
  forwardingRules?: [ 
    {
      forwardingRuleId?: string(name='ForwardingRuleId', description='The ID of the forwarding rule.', example='frule-bp1dii16gu9qdvb34****'),
    }
  ](name='ForwardingRules', description='Details about the forwarding rules.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model CreateForwardingRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateForwardingRulesResponseBody(name='body'),
}

/**
 * @summary Creates forwarding rules.
 *
 * @description HTTP and HTTPS listeners of Global Accelerator (GA) support domain name-based and path-based forwarding rules. After an HTTP or HTTPS listener receives a request, the system matches the request against the forwarding conditions in a forwarding rule and then performs the corresponding forwarding action. For example, if you set **Host** to `www.example.com` as the forwarding condition and **Forward** to `epg-bp1enpdcrqhl78g6r****` as the forwarding action in a forwarding rule, requests to the `www.example.com` domain name match this forwarding rule and are forwarded to the `epg-bp1enpdcrqhl78g6r****` endpoint group. Before you call this API operation to create a forwarding rule, we recommend that you understand forwarding rules. For more information, see [Forwarding rules](https://help.aliyun.com/document_detail/204224.html).
 * When you call this operation, take note of the following items:
 * *   **CreateForwardingRules** is an asynchronous operation. After you send a request, the system returns the ID of a forwarding rule, but the forwarding rule is still being created in the system background. You can call the [ListForwardingRules](https://help.aliyun.com/document_detail/205817.html) operation to query the state of the forwarding rule.
 *     *   If the forwarding rule is in the **configuring** state, it indicates that the rule is being created. In this case, you can only perform query operations.
 *     *   If the forwarding rule is in the **active** state, it indicates that the rule is created.
 * *   The **CreateForwardingRules** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request CreateForwardingRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateForwardingRulesResponse
 */
async function createForwardingRulesWithOptions(request: CreateForwardingRulesRequest, runtime: Util.RuntimeOptions): CreateForwardingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.forwardingRules)) {
    bodyFlat['ForwardingRules'] = request.forwardingRules;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateForwardingRules',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates forwarding rules.
 *
 * @description HTTP and HTTPS listeners of Global Accelerator (GA) support domain name-based and path-based forwarding rules. After an HTTP or HTTPS listener receives a request, the system matches the request against the forwarding conditions in a forwarding rule and then performs the corresponding forwarding action. For example, if you set **Host** to `www.example.com` as the forwarding condition and **Forward** to `epg-bp1enpdcrqhl78g6r****` as the forwarding action in a forwarding rule, requests to the `www.example.com` domain name match this forwarding rule and are forwarded to the `epg-bp1enpdcrqhl78g6r****` endpoint group. Before you call this API operation to create a forwarding rule, we recommend that you understand forwarding rules. For more information, see [Forwarding rules](https://help.aliyun.com/document_detail/204224.html).
 * When you call this operation, take note of the following items:
 * *   **CreateForwardingRules** is an asynchronous operation. After you send a request, the system returns the ID of a forwarding rule, but the forwarding rule is still being created in the system background. You can call the [ListForwardingRules](https://help.aliyun.com/document_detail/205817.html) operation to query the state of the forwarding rule.
 *     *   If the forwarding rule is in the **configuring** state, it indicates that the rule is being created. In this case, you can only perform query operations.
 *     *   If the forwarding rule is in the **active** state, it indicates that the rule is created.
 * *   The **CreateForwardingRules** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request CreateForwardingRulesRequest
 * @return CreateForwardingRulesResponse
 */
async function createForwardingRules(request: CreateForwardingRulesRequest): CreateForwardingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return createForwardingRulesWithOptions(request, runtime);
}

model CreateIpSetsRequest {
  accelerateRegion?: [ 
    {
      accelerateRegionId?: string(name='AccelerateRegionId', description='The ID of the acceleration region.

The number of regions that you can add varies based on the specification of the GA instance. For more information, see [Overview](https://help.aliyun.com/document_detail/153127.html).

This parameter is required.', example='cn-huhehaote'),
      bandwidth?: int32(name='Bandwidth', description='The bandwidth that you want to allocate to the acceleration region. Unit: **Mbit/s**.

>*  This parameter is required.
>*   You must allocate at least 2 Mbit/s of bandwidth to each acceleration region.
>*   The total bandwidth of all acceleration regions cannot exceed the bandwidth limit of your basic bandwidth plan.', example='2'),
      ipVersion?: string(name='IpVersion', description='The IP version used to connect to the GA instance. Valid values:

*   **IPv4** (default)
*   **IPv6**
*   **DUAL_STACK**: IPv4 and IPv6

> Only pay-as-you-go standard GA instances support DUAL_STACK.', example='IPv6'),
      ispType?: string(name='IspType', description='The line type of the elastic IP address (EIP) in the acceleration region. Valid values:

*   **BGP**: BGP (Multi-ISP) lines.
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines

> *   This parameter is required only if the bandwidth metering method of the GA instance is **pay-by-data transfer**.
>*   Different acceleration regions support different line types of EIPs.', example='BGP'),
    }
  ](name='AccelerateRegion', description='The information about the acceleration regions.

This parameter is required.'),
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1yeeq8yfoyszmqy****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model CreateIpSetsResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.', example='ga-bp1yeeq8yfoyszmq****'),
  ipSets?: [ 
    {
      accelerateRegionId?: string(name='AccelerateRegionId', description='The acceleration region ID.', example='cn-qingdao'),
      bandwidth?: int32(name='Bandwidth', description='The bandwidth allocated to the acceleration region. Unit: **Mbit/s**.', example='2'),
      ipSetId?: string(name='IpSetId', description='The acceleration region ID.', example='ips-bp11r5jb8ogp122xl****'),
      ispType?: string(name='IspType', description='The line type of the EIP in the acceleration region.', example='BGP'),
    }
  ](name='IpSets', description='The details about the acceleration regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
}

model CreateIpSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIpSetsResponseBody(name='body'),
}

/**
 * @summary Creates acceleration regions.
 *
 * @description *   **CreateIpSets** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of the task.
 *     *   If acceleration regions are in the **init** state, it indicates that the acceleration regions are being created. In this case, you can perform only query operations.
 *     *   If acceleration regions are in the **active** state, it indicates that the acceleration regions are created.
 * *   You cannot call the **CreateIpSets** operation again on the same GA instance before the previous operation is completed.
 *
 * @param request CreateIpSetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIpSetsResponse
 */
async function createIpSetsWithOptions(request: CreateIpSetsRequest, runtime: Util.RuntimeOptions): CreateIpSetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateRegion)) {
    query['AccelerateRegion'] = request.accelerateRegion;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpSets',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates acceleration regions.
 *
 * @description *   **CreateIpSets** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of the task.
 *     *   If acceleration regions are in the **init** state, it indicates that the acceleration regions are being created. In this case, you can perform only query operations.
 *     *   If acceleration regions are in the **active** state, it indicates that the acceleration regions are created.
 * *   You cannot call the **CreateIpSets** operation again on the same GA instance before the previous operation is completed.
 *
 * @param request CreateIpSetsRequest
 * @return CreateIpSetsResponse
 */
async function createIpSets(request: CreateIpSetsRequest): CreateIpSetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpSetsWithOptions(request, runtime);
}

model CreateListenerRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  certificates?: [ 
    {
      id?: string(name='Id', description='The ID of the SSL certificate.

> This parameter is required only when you create an HTTPS listener.', example='449****-cn-hangzhou'),
    }
  ](name='Certificates', description='The SSL certificates.'),
  clientAffinity?: string(name='ClientAffinity', description='Specifies whether to enable client affinity for the listener.

*   If this parameter is left empty, client affinity is disabled. After client affinity is disabled, requests from a specific client IP address may be forwarded to different endpoints.
*   To enable client affinity, set this parameter to **SOURCE_IP**. In this case, when a client accesses stateful applications, requests from the same client are forwarded to the same endpoint regardless of the source port or protocol.', example='SOURCE_IP'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** is different for each API request.', example='123e4567-e89b-12d3-a456-426655440000'),
  customRoutingEndpointGroupConfigurations?: [ 
    {
      description?: string(name='Description', description='The description of the endpoint group that is associated with the custom routing listener.

The description cannot exceed 256 characters in length and cannot contain `http://` or `https://`.

You can specify at most five endpoint group descriptions.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='test'),
      destinationConfigurations?: [ 
        {
          fromPort?: int32(name='FromPort', description='The first port used by the endpoint group that is associated with the custom routing listener.

Valid values: **1** to **65499**. The value of **FromPort** must be equal to or smaller than the value of **ToPort**.

You can specify up to 20 first ports for an endpoint group of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='80'),
          protocols?: [ string ](name='Protocols', description='The protocol used by the endpoint group that is associated with the custom routing listener.

You can specify up to four protocols in each mapping configuration for an endpoint group of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.'),
          toPort?: int32(name='ToPort', description='The last port used by the endpoint group that is associated with the custom routing listener.

Valid values: **1** to **65499**. The value of **FromPort** must be equal to or smaller than the value of **ToPort**.

You can specify up to 20 last ports for an endpoint group of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='80'),
        }
      ](name='DestinationConfigurations', description='The mapping configurations of the endpoint group that is associated with the custom routing listener.

You need to specify the port ranges and protocols used by the endpoint group. The ports are mapped to listener ports.

You can specify at most 20 mapping configurations for an endpoint group of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.'),
      endpointConfigurations?: [ 
        {
          endpoint?: string(name='Endpoint', description='The name of the vSwitch that is specified as an endpoint.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='vsw-test01'),
          policyConfigurations?: [ 
            {
              address?: string(name='Address', description='The IP address of the destination to which traffic is forwarded.

This parameter takes effect only if **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify up to 20 destination IP addresses for each endpoint of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='10.0.XX.XX'),
              portRanges?: [ 
                {
                  fromPort?: int32(name='FromPort', description='The first port of the destination port range. The value of this parameter must be in the port range of the endpoint group.

This parameter takes effect only if **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations in each endpoint of a custom routing listener. You can specify up to five first ports for each destination.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='80'),
                  toPort?: int32(name='ToPort', description='The last port of the destination port range. The value of this parameter must be in the port range of the endpoint group.

This parameter takes effect only if **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations in each endpoint of a custom routing listener. You can specify up to five end ports for each destination.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='80'),
                }
              ](name='PortRanges', description='The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you leave this parameter empty, traffic is distributed to all destination ports.

This parameter takes effect only if **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations in each endpoint of a custom routing listener. You can specify up to five port ranges for each destination.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.'),
            }
          ](name='PolicyConfigurations', description='The destination in the endpoint that is associated with the custom routing listener.

You can specify at most 20 destinations in each endpoint of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.'),
          trafficToEndpointPolicy?: string(name='TrafficToEndpointPolicy', description='The traffic policy for the endpoint that is associated with the custom routing listener. Valid values:

*   **DenyAll** (default): denies all traffic to the endpoint.
*   **AllowAll**: allows all traffic to the endpoint.
*   **AllowCustom**: allows traffic only to specified destinations in the endpoint.

If you set this parameter to AllowCustom, you must specify IP addresses and port ranges as the destinations to which traffic is distributed. If you specify only IP addresses and do not specify port ranges, GA can forward traffic to the specified IP addresses over all destination ports.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='DenyAll'),
          type?: string(name='Type', description='The service type of the endpoint that is associated with the custom routing listener.

Set the value to **PrivateSubNet**, which specifies a private CIDR block.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='PrivateSubNet'),
        }
      ](name='EndpointConfigurations', description='The endpoint that is associated with the custom routing listener.

You can configure at most 10 endpoints for an endpoint group of a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The region ID of the endpoint group that is associated with the custom routing listener.

You can enter the region IDs of up to five endpoint groups.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='cn-hangzhou'),
      name?: string(name='Name', description='The name of the endpoint group that is associated with the custom routing listener.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

You can specify at most five endpoint group names.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.', example='test'),
    }
  ](name='CustomRoutingEndpointGroupConfigurations', description='The endpoint group that is associated with the custom routing listener.

You can configure at most five endpoint groups for a custom routing listener.

> You can configure endpoint groups and endpoints for a custom routing listener only if the **Type** parameter is set to **CustomRouting**.'),
  description?: string(name='Description', description='The description of the listener. The description can be at most 200 characters in length.', example='Listener'),
  endpointGroupConfigurations?: [ 
    {
      enableClientIPPreservationProxyProtocol?: boolean(name='EnableClientIPPreservationProxyProtocol', description='Specifies whether to use the proxy protocol to preserve client IP addresses. Valid values:

*   **true**
*   **false** (default)

You can specify this parameter for up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='false'),
      enableClientIPPreservationToa?: boolean(name='EnableClientIPPreservationToa', description='Specifies whether to preserve client IP addresses by using the TCP Option Address (TOA) module. Valid values:

*   **true**
*   **false** (default)

You can specify this parameter for up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='false'),
      endpointConfigurations?: [ 
        {
          endpoint?: string(name='Endpoint', description='The IP address or domain name of the endpoint that is associated with the intelligent routing listener.

You can specify up to 100 endpoint IP addresses or domain names for an endpoint group of an intelligent routing listener.

>  If you set **Type** to **Standard**, you can configure endpoint groups and endpoints, and this parameter is required.', example='47.0.XX.XX'),
          subAddress?: string(name='SubAddress', description='The private IP address of the elastic network interface (ENI).

>  If the endpoint type is **ENI**, you can specify this parameter. If you do not specify this parameter, the primary private IP address of the ENI is used.', example='172.168.XX.XX'),
          type?: string(name='Type', description='The type of the endpoint that is associated with the intelligent routing listener. Valid values:

*   **Domain**: a custom domain name
*   **Ip**: a custom IP address
*   **PublicIp**: a public IP address provided by Alibaba Cloud
*   **ECS**: an Elastic Compute Service (ECS) instance
*   **SLB**: a Server Load Balancer (SLB) instance
*   **ALB**: an Application Load Balancer (ALB) instance
*   **OSS**: an Object Storage Service (OSS) bucket

You can specify up to 100 endpoint types for an endpoint group of an intelligent routing listener.

> *   If you set **Type** to **Standard**, you can configure endpoint groups and endpoints for an intelligent routing listener, and this parameter is required.
>*   If you set this parameter to **ECS** or **SLB** and the service-linked role AliyunServiceRoleForGaVpcEndpoint does not exist, the system automatically creates the service-linked role.
>*   If you set this parameter to **ALB** and the service-linked role AliyunServiceRoleForGaAlb does not exist, the system automatically creates the service-linked role.
>*   If you set this parameter to **OSS** and the service-linked role AliyunServiceRoleForGaOss does not exist, the system automatically creates the service-linked role.  
> For more information, see [Service linked roles](https://help.aliyun.com/document_detail/178360.html).', example='Ip'),
          weight?: long(name='Weight', description='The weight of the endpoint that is associated with the intelligent routing listener.

Valid values: **0** to **255**.

You can specify the weights of up to 100 endpoints for an endpoint group of an intelligent routing listener.

> *   If you set **Type** to **Standard**, you can configure endpoint groups and endpoints for an intelligent routing listener, and this parameter is required.
>*   If you set the weight of an endpoint to 0, GA does not route network traffic to the endpoint. Make sure that you are aware of the impact on your business before you set the endpoint weight to 0.', example='20'),
        }
      ](name='EndpointConfigurations', description='The endpoint that is associated with the intelligent routing listener.'),
      endpointGroupDescription?: string(name='EndpointGroupDescription', description='The description of the endpoint group that is associated with the intelligent routing listener.

The description can be up to 256 characters in length and cannot contain `http://` or `https://`.

You can enter the descriptions of up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='test'),
      endpointGroupName?: string(name='EndpointGroupName', description='The name of the endpoint group that is associated with the intelligent routing listener.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

You can enter the names of up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='test'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The region ID of the endpoint group that is associated with the intelligent routing listener.

You can enter the region IDs of up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='cn-hangzhou'),
      endpointGroupType?: string(name='EndpointGroupType', description='The type of the endpoint group associated with the intelligent routing listener. Valid values:

*   **default** (default)
*   **virtual**

You can specify up to 10 endpoint group types.

> *   You can configure endpoint groups and endpoints for an intelligent routing listener only if you set **Type** to **Standard**.
>*   Only HTTP intelligent routing listeners and HTTPS intelligent routing listeners support virtual endpoint groups.', example='default'),
      endpointProtocolVersion?: string(name='EndpointProtocolVersion', description='The backend service protocol version of the endpoint that is associated with the intelligent routing listener. Valid values:

*   **HTTP1.1** (default)
*   **HTTP2**

>*   You can specify this parameter only for **HTTPS** endpoint request protocol.'),
      endpointRequestProtocol?: string(name='EndpointRequestProtocol', description='The backend service protocol of the endpoint that is associated with the intelligent routing listener. Valid values:

*   **HTTP** (default)
*   **HTTPS**

You can specify up to 10 backend service protocols.

> *   You can configure endpoint groups and endpoints for an intelligent routing listener only if you set **Type** to **Standard**.
>*   You can specify this parameter only for HTTP and HTTPS intelligent routing listeners.
>*   For an HTTP listener, the protocol must be **HTTP**.', example='HTTP'),
      healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable health checks for the endpoint group. Valid values:

*   **true**
*   **false** (default)

You can enable the health check feature for up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='false'),
      healthCheckIntervalSeconds?: long(name='HealthCheckIntervalSeconds', description='The interval at which health checks are performed. Unit: seconds.

You can specify up to 10 health check intervals.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='3'),
      healthCheckPath?: string(name='HealthCheckPath', description='The path to which health check requests are sent.

You can specify up to 10 health check paths.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='/healthcheck'),
      healthCheckPort?: long(name='HealthCheckPort', description='The port that is used for health checks. Valid values: **1** to **65535**.

You can specify up to 10 health check ports.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='20'),
      healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol over which health check requests are sent. Valid values:

*   **tcp**
*   **http**
*   **https**

You can specify up to 10 health check protocols.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='tcp'),
      portOverrides?: [ 
        {
          endpointPort?: long(name='EndpointPort', description='The endpoint port that is mapped to the listener port.

You can specify up to five endpoint ports.

>*   You can configure endpoint groups and endpoints for an intelligent routing listener only if you set **Type** to **Standard**.
>*   Only HTTP and HTTPS intelligent routing listeners support port mappings.', example='80'),
          listenerPort?: long(name='ListenerPort', description='The listener port that is mapped to the endpoint port.

You can specify up to five listener ports.

> *   You can configure endpoint groups and endpoints for an intelligent routing listener only if you set **Type** to **Standard**.
>*   Only HTTP and HTTPS intelligent routing listeners support port mappings.
>*   The listener port in a port mapping must be the port that is used by the current listener.', example='443'),
        }
      ](name='PortOverrides', description='The port mapping.'),
      thresholdCount?: long(name='ThresholdCount', description='The number of consecutive health check failures that must occur before a healthy endpoint group is considered unhealthy, or the number of consecutive health check successes that must occur before an unhealthy endpoint group is considered healthy. Valid values: **2** to **10**. Default value: **3**.

You can specify the number of successful consecutive health checks or failed consecutive health checks for up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='3'),
      trafficPercentage?: long(name='TrafficPercentage', description='The traffic distribution ratio. If an intelligent routing listener is associated with multiple endpoint groups, you can configure this parameter to specify the ratio of traffic distributed to each endpoint group.

Valid values: **1** to **100**. Default value: **100**.

You can specify traffic distribution ratios for up to 10 endpoint groups.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.', example='100'),
    }
  ](name='EndpointGroupConfigurations', description='The endpoint groups that are associated with the intelligent routing listener.

You can configure up to 10 endpoint groups for an intelligent routing listener.

>  You can configure endpoint groups and endpoints only if you set **Type** to **Standard**.'),
  httpVersion?: string(name='HttpVersion', description='The maximum version of the HTTP protocol. Valid values:

*   **http3**
*   **http2** (default)
*   **http1.1**

>  Only HTTPS listeners support this parameter.', example='http2'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of idle connections. Unit: seconds.

*   TCP: 10-900. Default value: 900. Unit: seconds.
*   UDP: 10-20. Default value: 20. Unit: seconds.
*   HTTP/HTTPS: 1-60. Default value: 15. Unit: seconds.', example='900'),
  name?: string(name='Name', description='The name of the listener.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.', example='Listener'),
  portRanges?: [ 
    {
      fromPort?: int32(name='FromPort', description='The first port of the listener port range that you want to use to receive and forward requests to endpoints.

Valid values: **1** to **65499**. The value of **FromPort** must be smaller than or equal to the value of **ToPort**.

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).

> You can configure only one listener port for an HTTP or HTTPS listener. In this case, the first port is the same as the last port.

This parameter is required.', example='20'),
      toPort?: int32(name='ToPort', description='The last port of the listener port range that you want to use to receive and forward requests to endpoints.

Valid values: **1** to **65499**. The value of **FromPort** must be smaller than or equal to the value of **ToPort**.

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).

> You can configure only one listener port for an HTTP or HTTPS listener. In this case, the first port is the same as the last port.

This parameter is required.', example='20'),
    }
  ](name='PortRanges', description='The listener ports. Valid values: **1** to **65499**. The maximum number of ports that can be configured depends on the routing type and protocol of the listener. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).

This parameter is required.'),
  protocol?: string(name='Protocol', description='The network transmission protocol that you want to use for the listener. Valid values:

*   **tcp**: TCP
*   **udp**: UDP
*   **http**: HTTP
*   **https**: HTTPS', example='tcp'),
  proxyProtocol?: boolean(name='ProxyProtocol', description='Specifies whether to preserve client IP addresses. Valid values:

*   **true**: enables the feature. After client IP addresses are preserved, you can view client IP addresses on the endpoints.
*   **false** (default): disables the feature.

> This parameter will be deprecated in the API operations that are used to configure listeners. We recommend that you set this parameter when you call API operations to configure endpoint groups. For more information about the **ProxyProtocol** parameter, see [CreateEndpointGroup](https://help.aliyun.com/document_detail/153259.html) and [UpdateEndpointGroup](https://help.aliyun.com/document_detail/153262.html).', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period for HTTP or HTTPS requests. Unit: seconds.

Valid values: 1 to 180. Default value: 60. Unit: seconds.

>  This parameter takes effect only for HTTP or HTTPS listeners. If the backend server does not respond within the timeout period, GA returns an HTTP 504 error code to the client.', example='15'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy. Valid values:

*   **tls_cipher_policy_1_0**

    *   Supported Transport Layer Security (TLS) versions: TLS 1.0, TLS 1.1, and TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_1**

    *   Supported TLS versions: TLS 1.1 and TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_2**

    *   Supported TLS version: TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_2_strict**

    *   Supported TLS version: TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA

*   **tls_cipher_policy_1_2_strict_with_1_3**

    *   Supported TLS versions: TLS 1.2 and TLS 1.3
    *   Supported cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-ECDSA-AES128-SHA, ECDHE-ECDSA-AES256-SHA, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA

> This parameter is available only when you create an HTTPS listener.', example='tls_cipher_policy_1_0'),
  type?: string(name='Type', description='The routing type of the listener. Valid values:

*   **Standard** (default): intelligent routing
*   **CustomRouting**: custom routing

> *   Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager.
> *   You can create only listeners of the same routing type for a standard GA instance. You cannot change the routing types of listeners. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).', example='Standard'),
  XForwardedForConfig?: {
    XForwardedForGaApEnabled?: boolean(name='XForwardedForGaApEnabled', description='Specifies whether to use the `GA-AP` header to retrieve the information about acceleration regions. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XForwardedForGaIdEnabled?: boolean(name='XForwardedForGaIdEnabled', description='Specifies whether to use the `GA-ID` header to retrieve the ID of the GA instance. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XForwardedForPortEnabled?: boolean(name='XForwardedForPortEnabled', description='Specifies whether to use the `GA-X-Forward-Port` header to retrieve the listener ports of the GA instance. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Specifies whether to use the `GA-X-Forward-Proto` header to retrieve the listener protocol of the GA instance. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XRealIpEnabled?: boolean(name='XRealIpEnabled', description='Specifies whether to use the `X-Real-IP` header to retrieve client IP addresses. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
  }(name='XForwardedForConfig', description='The `XForward` headers.'),
}

model CreateListenerResponseBody = {
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateListenerResponseBody(name='body'),
}

/**
 * @summary A listener checks connection requests and distributes the requests to endpoints based on forwarding rules that are defined by the scheduling algorithm. You can call the CreateListener operation to create a listener for a GA instance.
 *
 * @description When you call this operation, take note of the following items:
 * *   **CreateListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of the task.
 *     *   If the listener is in the **init** state, the listener is being created. In this state, you can perform only query operations.
 *     *   If the listener is in the **active** state, the listener is created.
 * *   You cannot repeatedly call the **CreateListener** operation for the same GA instance within the specified period of time.
 *
 * @param request CreateListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateListenerResponse
 */
async function createListenerWithOptions(request: CreateListenerRequest, runtime: Util.RuntimeOptions): CreateListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!Util.isUnset(request.clientAffinity)) {
    query['ClientAffinity'] = request.clientAffinity;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.customRoutingEndpointGroupConfigurations)) {
    query['CustomRoutingEndpointGroupConfigurations'] = request.customRoutingEndpointGroupConfigurations;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointGroupConfigurations)) {
    query['EndpointGroupConfigurations'] = request.endpointGroupConfigurations;
  }
  if (!Util.isUnset(request.httpVersion)) {
    query['HttpVersion'] = request.httpVersion;
  }
  if (!Util.isUnset(request.idleTimeout)) {
    query['IdleTimeout'] = request.idleTimeout;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.portRanges)) {
    query['PortRanges'] = request.portRanges;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.proxyProtocol)) {
    query['ProxyProtocol'] = request.proxyProtocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.requestTimeout)) {
    query['RequestTimeout'] = request.requestTimeout;
  }
  if (!Util.isUnset(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.XForwardedForConfig)) {
    query['XForwardedForConfig'] = request.XForwardedForConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary A listener checks connection requests and distributes the requests to endpoints based on forwarding rules that are defined by the scheduling algorithm. You can call the CreateListener operation to create a listener for a GA instance.
 *
 * @description When you call this operation, take note of the following items:
 * *   **CreateListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of the task.
 *     *   If the listener is in the **init** state, the listener is being created. In this state, you can perform only query operations.
 *     *   If the listener is in the **active** state, the listener is created.
 * *   You cannot repeatedly call the **CreateListener** operation for the same GA instance within the specified period of time.
 *
 * @param request CreateListenerRequest
 * @return CreateListenerResponse
 */
async function createListener(request: CreateListenerRequest): CreateListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return createListenerWithOptions(request, runtime);
}

model CreateSpareIpsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true:** performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (defalut): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  spareIps?: [ string ](name='SpareIps', description='The secondary IP addresses to be created for the CNAME. If an acceleration area of the GA instance becomes unavailable, access traffic is redirected to the secondary IP addresses.

You can specify up to two secondary IP addresses.

This parameter is required.'),
}

model CreateSpareIpsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model CreateSpareIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSpareIpsResponseBody(name='body'),
}

/**
 * @summary Creates secondary IP addresses for a CNAME that is assigned to a Global Accelerator (GA) instance. If an acceleration area of the GA instance becomes unavailable, access traffic is redirected to the secondary IP addresses.
 *
 * @description *   **CreateSpareIps** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that secondary IP addresses are being created for the CNAME that is assigned to the GA instance. In this case, you can only perform query operations.
 *     *   If the GA instance is in the **active** state, it indicates that secondary IP addresses are created for the CNAME that is assigned to the GA instance.
 * *   The **CreateSpareIps** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request CreateSpareIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSpareIpsResponse
 */
async function createSpareIpsWithOptions(request: CreateSpareIpsRequest, runtime: Util.RuntimeOptions): CreateSpareIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.spareIps)) {
    query['SpareIps'] = request.spareIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSpareIps',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates secondary IP addresses for a CNAME that is assigned to a Global Accelerator (GA) instance. If an acceleration area of the GA instance becomes unavailable, access traffic is redirected to the secondary IP addresses.
 *
 * @description *   **CreateSpareIps** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that secondary IP addresses are being created for the CNAME that is assigned to the GA instance. In this case, you can only perform query operations.
 *     *   If the GA instance is in the **active** state, it indicates that secondary IP addresses are created for the CNAME that is assigned to the GA instance.
 * *   The **CreateSpareIps** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request CreateSpareIpsRequest
 * @return CreateSpareIpsResponse
 */
async function createSpareIps(request: CreateSpareIpsRequest): CreateSpareIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSpareIpsWithOptions(request, runtime);
}

model DeleteAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance that you want to delete.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', description='The ID of the region where your GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteAcceleratorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DeleteAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAcceleratorResponseBody(name='body'),
}

/**
 * @summary Deletes a Global Accelerator (GA) instance.
 *
 * @description *   You cannot delete subscription GA instances.
 * *   **DeleteAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of the task.
 *     *   If the GA instance is in the **deleting** state, the GA instance is being deleted. In this case, you can perform only query operations.
 *     *   If the GA instance cannot be queried, the GA instance is deleted.
 *
 * @param request DeleteAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAcceleratorResponse
 */
async function deleteAcceleratorWithOptions(request: DeleteAcceleratorRequest, runtime: Util.RuntimeOptions): DeleteAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a Global Accelerator (GA) instance.
 *
 * @description *   You cannot delete subscription GA instances.
 * *   **DeleteAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of the task.
 *     *   If the GA instance is in the **deleting** state, the GA instance is being deleted. In this case, you can perform only query operations.
 *     *   If the GA instance cannot be queried, the GA instance is deleted.
 *
 * @param request DeleteAcceleratorRequest
 * @return DeleteAcceleratorResponse
 */
async function deleteAccelerator(request: DeleteAcceleratorRequest): DeleteAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAcceleratorWithOptions(request, runtime);
}

model DeleteAclRequest {
  aclId?: string(name='AclId', description='The ID of the ACL.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='02fb3da4****'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteAclResponseBody = {
  aclId?: string(name='AclId', description='The ID of the ACL.', example='nacl-hp34s2h0xx1ht4nwo****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DeleteAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAclResponseBody(name='body'),
}

/**
 * @summary Deletes a access control list (ACL) of a Global Accelerator (GA) instance.
 *
 * @description **DeleteAcl** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) operation to query the status of an ACL.
 * *   If the ACL is in the **deleting** state, it indicates that the ACL is being deleted. In this case, you can perform only query operations.
 * *   If the ACL cannot be queried, it indicates that the ACL is deleted.
 *
 * @param request DeleteAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAclResponse
 */
async function deleteAclWithOptions(request: DeleteAclRequest, runtime: Util.RuntimeOptions): DeleteAclResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAcl',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a access control list (ACL) of a Global Accelerator (GA) instance.
 *
 * @description **DeleteAcl** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) operation to query the status of an ACL.
 * *   If the ACL is in the **deleting** state, it indicates that the ACL is being deleted. In this case, you can perform only query operations.
 * *   If the ACL cannot be queried, it indicates that the ACL is deleted.
 *
 * @param request DeleteAclRequest
 * @return DeleteAclResponse
 */
async function deleteAcl(request: DeleteAclRequest): DeleteAclResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAclWithOptions(request, runtime);
}

model DeleteApplicationMonitorRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task that you want to delete.

This parameter is required.', example='sm-bp1fpdjfju9k8yr1y****'),
}

model DeleteApplicationMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Deletes an origin probing task.
 *
 * @description *   **DeleteApplicationMonitor** is an asynchronous operation. After you call this operation, the system returns a request ID, but the operation is still being performed in the system background. You can call the [ListApplicationMonitor](https://help.aliyun.com/document_detail/408462.html) operation to query the state of an origin probing task.
 *     *   If the origin probing task is in the **deleting** state, it indicates that the task is being deleted. In this case, you can perform only query operations.
 *     *   If the origin probing task cannot be queried, it indicates that the task is deleted.
 * *   The **DeleteApplicationMonitor** operation cannot be called repeatedly for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApplicationMonitorResponse
 */
async function deleteApplicationMonitorWithOptions(request: DeleteApplicationMonitorRequest, runtime: Util.RuntimeOptions): DeleteApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an origin probing task.
 *
 * @description *   **DeleteApplicationMonitor** is an asynchronous operation. After you call this operation, the system returns a request ID, but the operation is still being performed in the system background. You can call the [ListApplicationMonitor](https://help.aliyun.com/document_detail/408462.html) operation to query the state of an origin probing task.
 *     *   If the origin probing task is in the **deleting** state, it indicates that the task is being deleted. In this case, you can perform only query operations.
 *     *   If the origin probing task cannot be queried, it indicates that the task is deleted.
 * *   The **DeleteApplicationMonitor** operation cannot be called repeatedly for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteApplicationMonitorRequest
 * @return DeleteApplicationMonitorResponse
 */
async function deleteApplicationMonitor(request: DeleteApplicationMonitorRequest): DeleteApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApplicationMonitorWithOptions(request, runtime);
}

model DeleteBandwidthPackageRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The bandwidth plan ID.

This parameter is required.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteBandwidthPackageResponseBody = {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The bandwidth plan ID.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DeleteBandwidthPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBandwidthPackageResponseBody(name='body'),
}

/**
 * @summary Deletes a bandwidth plan.
 *
 * @description *   By default, subscription bandwidth plans cannot be deleted. If you want to unsubscribe from subscription bandwidth plans, go to the [Unsubscribe](https://usercenter2-intl.aliyun.com/refund/refund) page. Before you can unsubscribe from a subscription bandwidth plan that is associated with a Global Accelerator (GA) instance, you must disassociate the bandwidth plan from the GA instance. For information about how to disassociate a bandwidth plan from a GA instance, see [BandwidthPackageRemoveAccelerator](https://help.aliyun.com/document_detail/153240.html).
 * *   Bandwidth plans that are associated with GA instances cannot be deleted. Before you can delete a bandwidth plan that is associated with a GA instance, you must disassociate the bandwidth plan from the GA instance. For information about how to disassociate a bandwidth plan from a GA instance, see [BandwidthPackageRemoveAccelerator](https://help.aliyun.com/document_detail/153240.html).
 * *   **DeleteBandwidthPackage** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the task.
 *     *   If the bandwidth plan is in the **deleting** state, the bandwidth plan is being deleted. In this case, you can perform only query operations.
 *     *   If the bandwidth plan cannot be found, the bandwidth plan is deleted.
 * *   The **DeleteBandwidthPackage** operation cannot be repeatedly called for the same bandwidth plan within a specific period of time.
 *
 * @param request DeleteBandwidthPackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBandwidthPackageResponse
 */
async function deleteBandwidthPackageWithOptions(request: DeleteBandwidthPackageRequest, runtime: Util.RuntimeOptions): DeleteBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBandwidthPackage',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a bandwidth plan.
 *
 * @description *   By default, subscription bandwidth plans cannot be deleted. If you want to unsubscribe from subscription bandwidth plans, go to the [Unsubscribe](https://usercenter2-intl.aliyun.com/refund/refund) page. Before you can unsubscribe from a subscription bandwidth plan that is associated with a Global Accelerator (GA) instance, you must disassociate the bandwidth plan from the GA instance. For information about how to disassociate a bandwidth plan from a GA instance, see [BandwidthPackageRemoveAccelerator](https://help.aliyun.com/document_detail/153240.html).
 * *   Bandwidth plans that are associated with GA instances cannot be deleted. Before you can delete a bandwidth plan that is associated with a GA instance, you must disassociate the bandwidth plan from the GA instance. For information about how to disassociate a bandwidth plan from a GA instance, see [BandwidthPackageRemoveAccelerator](https://help.aliyun.com/document_detail/153240.html).
 * *   **DeleteBandwidthPackage** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the task.
 *     *   If the bandwidth plan is in the **deleting** state, the bandwidth plan is being deleted. In this case, you can perform only query operations.
 *     *   If the bandwidth plan cannot be found, the bandwidth plan is deleted.
 * *   The **DeleteBandwidthPackage** operation cannot be repeatedly called for the same bandwidth plan within a specific period of time.
 *
 * @param request DeleteBandwidthPackageRequest
 * @return DeleteBandwidthPackageResponse
 */
async function deleteBandwidthPackage(request: DeleteBandwidthPackageRequest): DeleteBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBandwidthPackageWithOptions(request, runtime);
}

model DeleteBasicAccelerateIpRequest {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address that you want to delete.

You can call the [ListBasicAccelerateIps](https://help.aliyun.com/document_detail/2253393.html) operation to query the ID of the accelerated IP address.

This parameter is required.', example='gaip-bp1****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteBasicAccelerateIpResponseBody = {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address that is deleted.', example='gaip-bp1****'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteBasicAccelerateIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBasicAccelerateIpResponseBody(name='body'),
}

/**
 * @summary Deletes an accelerated IP address of a basic Global Accelerator (GA) instance.
 *
 * @description *   **DeleteBasicAccelerateIp** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) operation to query the status of an accelerated IP address.
 *     *   If an accelerated IP address is in the **deleting** state, the accelerated IP address is being deleted. In this case, you can perform only query operations.
 *     *   If the system fails to return information about an accelerated IP address, the accelerated IP address is deleted.
 * *   You cannot repeatedly call the **DeleteBasicAccelerateIp** operation for the same basic GA instance within a specific period of time.
 *
 * @param request DeleteBasicAccelerateIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBasicAccelerateIpResponse
 */
async function deleteBasicAccelerateIpWithOptions(request: DeleteBasicAccelerateIpRequest, runtime: Util.RuntimeOptions): DeleteBasicAccelerateIpResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBasicAccelerateIp',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an accelerated IP address of a basic Global Accelerator (GA) instance.
 *
 * @description *   **DeleteBasicAccelerateIp** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) operation to query the status of an accelerated IP address.
 *     *   If an accelerated IP address is in the **deleting** state, the accelerated IP address is being deleted. In this case, you can perform only query operations.
 *     *   If the system fails to return information about an accelerated IP address, the accelerated IP address is deleted.
 * *   You cannot repeatedly call the **DeleteBasicAccelerateIp** operation for the same basic GA instance within a specific period of time.
 *
 * @param request DeleteBasicAccelerateIpRequest
 * @return DeleteBasicAccelerateIpResponse
 */
async function deleteBasicAccelerateIp(request: DeleteBasicAccelerateIpRequest): DeleteBasicAccelerateIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBasicAccelerateIpWithOptions(request, runtime);
}

model DeleteBasicAccelerateIpEndpointRelationRequest {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.

You can call the [ListBasicAccelerateIps](https://help.aliyun.com/document_detail/2253393.html) operation to query the ID of the accelerated IP address.

This parameter is required.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.

You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/2253406.html) operation to query the ID of the endpoint.

This parameter is required.', example='ep-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteBasicAccelerateIpEndpointRelationResponseBody = {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address of the basic GA instance.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint that is associated with the basic GA instance.', example='ep-bp14sz7ftcwwjgrdm****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The status of the mapping between the accelerated IP address and endpoint.

>  This parameter is not in use and empty.', example='null'),
}

model DeleteBasicAccelerateIpEndpointRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBasicAccelerateIpEndpointRelationResponseBody(name='body'),
}

/**
 * @summary Deletes a mapping between an accelerated IP address and an endpoint for a basic Global Accelerator (GA) instance.
 *
 * @description *   **DeleteBasicAccelerateIpEndpointRelation** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the following operations to check whether an accelerated IP address is disassociated from an endpoint:
 *     *   You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) and [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) operations to query the status of an accelerated IP address and an endpoint. If the accelerated IP address and the endpoint are in the **unbinding** state, the accelerated IP address is being disassociated from the endpoint. In this case, you can query the IP address and endpoint but cannot perform other operations.
 *     *   If the association status between the accelerated IP address and the endpoint cannot be queried by calling the [ListBasicAccelerateIpEndpointRelations](https://help.aliyun.com/document_detail/466803.html) operation, the accelerated IP address is disassociated from the endpoint.
 * *   The **DeleteBasicAccelerateIpEndpointRelation** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request DeleteBasicAccelerateIpEndpointRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBasicAccelerateIpEndpointRelationResponse
 */
async function deleteBasicAccelerateIpEndpointRelationWithOptions(request: DeleteBasicAccelerateIpEndpointRelationRequest, runtime: Util.RuntimeOptions): DeleteBasicAccelerateIpEndpointRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBasicAccelerateIpEndpointRelation',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a mapping between an accelerated IP address and an endpoint for a basic Global Accelerator (GA) instance.
 *
 * @description *   **DeleteBasicAccelerateIpEndpointRelation** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the following operations to check whether an accelerated IP address is disassociated from an endpoint:
 *     *   You can call the [GetBasicAccelerateIp](https://help.aliyun.com/document_detail/466794.html) and [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) operations to query the status of an accelerated IP address and an endpoint. If the accelerated IP address and the endpoint are in the **unbinding** state, the accelerated IP address is being disassociated from the endpoint. In this case, you can query the IP address and endpoint but cannot perform other operations.
 *     *   If the association status between the accelerated IP address and the endpoint cannot be queried by calling the [ListBasicAccelerateIpEndpointRelations](https://help.aliyun.com/document_detail/466803.html) operation, the accelerated IP address is disassociated from the endpoint.
 * *   The **DeleteBasicAccelerateIpEndpointRelation** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request DeleteBasicAccelerateIpEndpointRelationRequest
 * @return DeleteBasicAccelerateIpEndpointRelationResponse
 */
async function deleteBasicAccelerateIpEndpointRelation(request: DeleteBasicAccelerateIpEndpointRelationRequest): DeleteBasicAccelerateIpEndpointRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBasicAccelerateIpEndpointRelationWithOptions(request, runtime);
}

model DeleteBasicAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  regionId?: string(name='RegionId', description='The ID of the region to which the basic GA instance belongs. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteBasicAcceleratorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model DeleteBasicAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBasicAcceleratorResponseBody(name='body'),
}

/**
 * @summary Deletes a basic Global Accelerator (GA) instance.
 *
 * @description *   You cannot delete subscription basic GA instances. You can unsubscribe from a basic GA instance on the [Unsubscribe](https://usercenter2-intl.aliyun.com/refund/refund) page. Before you unsubscribe from a basic GA instance, make sure that the acceleration areas and endpoint groups of the GA instance are deleted and no bandwidth plans are associated with the GA instance.
 *     *   For information about how to delete an acceleration area, see [DeleteBasicIpSet](https://help.aliyun.com/document_detail/2253388.html).
 *     *   For information about how to delete an endpoint group, see [DeleteBasicEndpointGroup](https://help.aliyun.com/document_detail/2253399.html).
 *     *   For information about how to disassociate a bandwidth plan from a basic GA instance, see [BandwidthPackageRemoveAccelerator](https://help.aliyun.com/document_detail/153240.html).
 * *   Before you call this operation to delete a pay-as-you-go basic GA instance, make sure that all data is migrated and the acceleration areas and endpoint groups of the instance are deleted.
 *     *   For information about how to delete an acceleration area, see [DeleteBasicIpSet](https://help.aliyun.com/document_detail/2253388.html).
 *     *   For information about how to delete an endpoint group, see [DeleteBasicEndpointGroup](https://help.aliyun.com/document_detail/2253399.html).
 * *   **DeleteBasicAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/353188.html) operation to query the status of the task.
 *     *   If the basic GA instance is in the **deleting** state, it indicates that the instance is being deleted. In this case, you can perform only query operations.
 *     *   If the information about the basic GA instance is not displayed in the response, it indicates that the instance is deleted.
 *
 * @param request DeleteBasicAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBasicAcceleratorResponse
 */
async function deleteBasicAcceleratorWithOptions(request: DeleteBasicAcceleratorRequest, runtime: Util.RuntimeOptions): DeleteBasicAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBasicAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a basic Global Accelerator (GA) instance.
 *
 * @description *   You cannot delete subscription basic GA instances. You can unsubscribe from a basic GA instance on the [Unsubscribe](https://usercenter2-intl.aliyun.com/refund/refund) page. Before you unsubscribe from a basic GA instance, make sure that the acceleration areas and endpoint groups of the GA instance are deleted and no bandwidth plans are associated with the GA instance.
 *     *   For information about how to delete an acceleration area, see [DeleteBasicIpSet](https://help.aliyun.com/document_detail/2253388.html).
 *     *   For information about how to delete an endpoint group, see [DeleteBasicEndpointGroup](https://help.aliyun.com/document_detail/2253399.html).
 *     *   For information about how to disassociate a bandwidth plan from a basic GA instance, see [BandwidthPackageRemoveAccelerator](https://help.aliyun.com/document_detail/153240.html).
 * *   Before you call this operation to delete a pay-as-you-go basic GA instance, make sure that all data is migrated and the acceleration areas and endpoint groups of the instance are deleted.
 *     *   For information about how to delete an acceleration area, see [DeleteBasicIpSet](https://help.aliyun.com/document_detail/2253388.html).
 *     *   For information about how to delete an endpoint group, see [DeleteBasicEndpointGroup](https://help.aliyun.com/document_detail/2253399.html).
 * *   **DeleteBasicAccelerator** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/353188.html) operation to query the status of the task.
 *     *   If the basic GA instance is in the **deleting** state, it indicates that the instance is being deleted. In this case, you can perform only query operations.
 *     *   If the information about the basic GA instance is not displayed in the response, it indicates that the instance is deleted.
 *
 * @param request DeleteBasicAcceleratorRequest
 * @return DeleteBasicAcceleratorResponse
 */
async function deleteBasicAccelerator(request: DeleteBasicAcceleratorRequest): DeleteBasicAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBasicAcceleratorWithOptions(request, runtime);
}

model DeleteBasicEndpointRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint to be deleted belongs.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint that you want to delete.

This parameter is required.', example='ep-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteBasicEndpointResponseBody = {
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteBasicEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBasicEndpointResponseBody(name='body'),
}

/**
 * @summary Deletes an endpoint that is associated with a basic Global Accelerator (GA) instance.
 *
 * @description *   **DeleteBasicEndpoint** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) operation to query the status of endpoints.
 *     *   If the endpoint is in the **deleting** state, it indicates that the endpoint is being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint cannot be found, it indicates that the endpoint is deleted.
 * *   The **DeleteBasicEndpoint** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request DeleteBasicEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBasicEndpointResponse
 */
async function deleteBasicEndpointWithOptions(request: DeleteBasicEndpointRequest, runtime: Util.RuntimeOptions): DeleteBasicEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBasicEndpoint',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an endpoint that is associated with a basic Global Accelerator (GA) instance.
 *
 * @description *   **DeleteBasicEndpoint** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [ListBasicEndpoints](https://help.aliyun.com/document_detail/466831.html) operation to query the status of endpoints.
 *     *   If the endpoint is in the **deleting** state, it indicates that the endpoint is being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint cannot be found, it indicates that the endpoint is deleted.
 * *   The **DeleteBasicEndpoint** API operation cannot be repeatedly called for the same basic GA instance within a period of time.
 *
 * @param request DeleteBasicEndpointRequest
 * @return DeleteBasicEndpointResponse
 */
async function deleteBasicEndpoint(request: DeleteBasicEndpointRequest): DeleteBasicEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBasicEndpointWithOptions(request, runtime);
}

model DeleteBasicEndpointGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group that is associated with the basic GA instance.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
}

model DeleteBasicEndpointGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteBasicEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBasicEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Deletes an endpoint group that is associated with a basic Global Accelerator (GA) instance.
 *
 * @description Before you delete an endpoint group, take note of the following items:
 * *   If an endpoint in the endpoint group is associated with an accelerated IP address, you cannot delete the endpoint group. You can call the [DeleteBasicAccelerateIpEndpointRelation](https://help.aliyun.com/document_detail/2253413.html) operation to disassociate the endpoint from the accelerated IP address.
 * *   If no endpoint in the endpoint group is associated with an accelerated IP address, you can delete the endpoint group. When you delete an endpoint group, all endpoints in the endpoint group are deleted.
 * *   **DeleteBasicEndpointGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicEndpointGroup](https://help.aliyun.com/document_detail/362984.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **deleting** state, the endpoint group is being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint group cannot be queried, the endpoint group is deleted.
 * *   The **DeleteBasicEndpointGroup** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request DeleteBasicEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBasicEndpointGroupResponse
 */
async function deleteBasicEndpointGroupWithOptions(request: DeleteBasicEndpointGroupRequest, runtime: Util.RuntimeOptions): DeleteBasicEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBasicEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an endpoint group that is associated with a basic Global Accelerator (GA) instance.
 *
 * @description Before you delete an endpoint group, take note of the following items:
 * *   If an endpoint in the endpoint group is associated with an accelerated IP address, you cannot delete the endpoint group. You can call the [DeleteBasicAccelerateIpEndpointRelation](https://help.aliyun.com/document_detail/2253413.html) operation to disassociate the endpoint from the accelerated IP address.
 * *   If no endpoint in the endpoint group is associated with an accelerated IP address, you can delete the endpoint group. When you delete an endpoint group, all endpoints in the endpoint group are deleted.
 * *   **DeleteBasicEndpointGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicEndpointGroup](https://help.aliyun.com/document_detail/362984.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **deleting** state, the endpoint group is being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint group cannot be queried, the endpoint group is deleted.
 * *   The **DeleteBasicEndpointGroup** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request DeleteBasicEndpointGroupRequest
 * @return DeleteBasicEndpointGroupResponse
 */
async function deleteBasicEndpointGroup(request: DeleteBasicEndpointGroupRequest): DeleteBasicEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBasicEndpointGroupWithOptions(request, runtime);
}

model DeleteBasicIpSetRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region of the basic GA instance.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model DeleteBasicIpSetResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6D2BFF54-6AF2-4679-88C4-2F2E187F16CB'),
}

model DeleteBasicIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBasicIpSetResponseBody(name='body'),
}

/**
 * @summary Deletes the acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @description *   If an accelerated IP address is associated with an endpoint, you cannot delete the acceleration region. You can call the [DeleteBasicAccelerateIpEndpointRelation](https://help.aliyun.com/document_detail/2253413.html) operation to disassociate the accelerated IP address from the endpoint.
 * *   \\*\\*DeleteBasicIpSet\\*\\* is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicIpSet](https://help.aliyun.com/document_detail/362987.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **deleting** state, it indicates that the acceleration region is being deleted. In this case, you can perform only query operations.
 *     *   If the acceleration region cannot be queried, it indicates that the acceleration region is deleted.
 * *   The \\*\\*DeleteBasicIpSet\\*\\* operation cannot be repeatedly called for the same basic GA instance within a specific period of time.
 *
 * @param request DeleteBasicIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBasicIpSetResponse
 */
async function deleteBasicIpSetWithOptions(request: DeleteBasicIpSetRequest, runtime: Util.RuntimeOptions): DeleteBasicIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBasicIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @description *   If an accelerated IP address is associated with an endpoint, you cannot delete the acceleration region. You can call the [DeleteBasicAccelerateIpEndpointRelation](https://help.aliyun.com/document_detail/2253413.html) operation to disassociate the accelerated IP address from the endpoint.
 * *   \\*\\*DeleteBasicIpSet\\*\\* is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicIpSet](https://help.aliyun.com/document_detail/362987.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **deleting** state, it indicates that the acceleration region is being deleted. In this case, you can perform only query operations.
 *     *   If the acceleration region cannot be queried, it indicates that the acceleration region is deleted.
 * *   The \\*\\*DeleteBasicIpSet\\*\\* operation cannot be repeatedly called for the same basic GA instance within a specific period of time.
 *
 * @param request DeleteBasicIpSetRequest
 * @return DeleteBasicIpSetResponse
 */
async function deleteBasicIpSet(request: DeleteBasicIpSetRequest): DeleteBasicIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBasicIpSetWithOptions(request, runtime);
}

model DeleteCustomRoutingEndpointGroupDestinationsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationIds?: [ string ](name='DestinationIds', description='The IDs of the endpoint group mappings.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.

**

****

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteCustomRoutingEndpointGroupDestinationsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteCustomRoutingEndpointGroupDestinationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomRoutingEndpointGroupDestinationsResponseBody(name='body'),
}

/**
 * @summary Deletes mappings from an endpoint group that is associated with a custom routing listener.
 *
 * @description *   **DeleteCustomRoutingEndpointGroupDestinations** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, it indicates that mappings are being deleted from the endpoint group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state and no information about the mappings that you want to delete is found in the response when you call the [DescribeCustomRoutingEndpointGroupDestinations](https://help.aliyun.com/document_detail/449378.html) operation, it indicates the mappings are deleted from the endpoint group.
 * *   You cannot call the **DeleteCustomRoutingEndpointGroupDestinations** operation again on the same Global Accelerator (GA) instance before the previous request is completed.
 *
 * @param request DeleteCustomRoutingEndpointGroupDestinationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomRoutingEndpointGroupDestinationsResponse
 */
async function deleteCustomRoutingEndpointGroupDestinationsWithOptions(request: DeleteCustomRoutingEndpointGroupDestinationsRequest, runtime: Util.RuntimeOptions): DeleteCustomRoutingEndpointGroupDestinationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationIds)) {
    query['DestinationIds'] = request.destinationIds;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomRoutingEndpointGroupDestinations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes mappings from an endpoint group that is associated with a custom routing listener.
 *
 * @description *   **DeleteCustomRoutingEndpointGroupDestinations** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, it indicates that mappings are being deleted from the endpoint group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state and no information about the mappings that you want to delete is found in the response when you call the [DescribeCustomRoutingEndpointGroupDestinations](https://help.aliyun.com/document_detail/449378.html) operation, it indicates the mappings are deleted from the endpoint group.
 * *   You cannot call the **DeleteCustomRoutingEndpointGroupDestinations** operation again on the same Global Accelerator (GA) instance before the previous request is completed.
 *
 * @param request DeleteCustomRoutingEndpointGroupDestinationsRequest
 * @return DeleteCustomRoutingEndpointGroupDestinationsResponse
 */
async function deleteCustomRoutingEndpointGroupDestinations(request: DeleteCustomRoutingEndpointGroupDestinationsRequest): DeleteCustomRoutingEndpointGroupDestinationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomRoutingEndpointGroupDestinationsWithOptions(request, runtime);
}

model DeleteCustomRoutingEndpointGroupsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance that you want to query.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true:** performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false:** performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of the endpoint groups that you want to delete.

You can specify up to 10 endpoint group IDs.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteCustomRoutingEndpointGroupsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteCustomRoutingEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomRoutingEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Deletes multiple endpoint groups that are associated with a custom routing listener.
 *
 * @description *   **DeleteCustomRoutingEndpointGroups** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the state of the endpoint groups associated with a custom routing listener that you attempt to delete.
 *     *   If the endpoint groups are in the **deleting** state, the endpoint groups are being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint groups cannot be queried, the endpoint groups are deleted.
 * *   You cannot use the **DeleteCustomRoutingEndpointGroups** operation on the same Global Accelerator (GA) instance before the previous operation is complete.
 *
 * @param request DeleteCustomRoutingEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomRoutingEndpointGroupsResponse
 */
async function deleteCustomRoutingEndpointGroupsWithOptions(request: DeleteCustomRoutingEndpointGroupsRequest, runtime: Util.RuntimeOptions): DeleteCustomRoutingEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupIds)) {
    query['EndpointGroupIds'] = request.endpointGroupIds;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomRoutingEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes multiple endpoint groups that are associated with a custom routing listener.
 *
 * @description *   **DeleteCustomRoutingEndpointGroups** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the state of the endpoint groups associated with a custom routing listener that you attempt to delete.
 *     *   If the endpoint groups are in the **deleting** state, the endpoint groups are being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint groups cannot be queried, the endpoint groups are deleted.
 * *   You cannot use the **DeleteCustomRoutingEndpointGroups** operation on the same Global Accelerator (GA) instance before the previous operation is complete.
 *
 * @param request DeleteCustomRoutingEndpointGroupsRequest
 * @return DeleteCustomRoutingEndpointGroupsResponse
 */
async function deleteCustomRoutingEndpointGroups(request: DeleteCustomRoutingEndpointGroupsRequest): DeleteCustomRoutingEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomRoutingEndpointGroupsWithOptions(request, runtime);
}

model DeleteCustomRoutingEndpointTrafficPoliciesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint for which you want to delete traffic destinations.

>  This parameter is required.

This parameter is required.', example='ep-2zewuzypq5e6r3pfh****'),
  policyIds?: [ string ](name='PolicyIds', description='The IDs of the traffic destinations.

You can specify the IDs of up to 9,000 traffic destinations.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteCustomRoutingEndpointTrafficPoliciesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteCustomRoutingEndpointTrafficPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomRoutingEndpointTrafficPoliciesResponseBody(name='body'),
}

/**
 * @summary Deletes traffic destinations from an endpoint.
 *
 * @description *   **DeleteCustomRoutingEndpointTrafficPolicies** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of an endpoint group to check whether the traffic destinations are deleted.
 *     *   If the endpoint group is in the **updating** state, the traffic destinations are being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state and the traffic destinations that you want to delete cannot be queried by calling the [DescribeCustomRoutingEndPointTrafficPolicy](https://help.aliyun.com/document_detail/449392.html) operation, the traffic destinations are deleted.
 * *   The **DeleteCustomRoutingEndpointTrafficPolicies** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteCustomRoutingEndpointTrafficPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomRoutingEndpointTrafficPoliciesResponse
 */
async function deleteCustomRoutingEndpointTrafficPoliciesWithOptions(request: DeleteCustomRoutingEndpointTrafficPoliciesRequest, runtime: Util.RuntimeOptions): DeleteCustomRoutingEndpointTrafficPoliciesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.policyIds)) {
    query['PolicyIds'] = request.policyIds;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomRoutingEndpointTrafficPolicies',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes traffic destinations from an endpoint.
 *
 * @description *   **DeleteCustomRoutingEndpointTrafficPolicies** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of an endpoint group to check whether the traffic destinations are deleted.
 *     *   If the endpoint group is in the **updating** state, the traffic destinations are being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state and the traffic destinations that you want to delete cannot be queried by calling the [DescribeCustomRoutingEndPointTrafficPolicy](https://help.aliyun.com/document_detail/449392.html) operation, the traffic destinations are deleted.
 * *   The **DeleteCustomRoutingEndpointTrafficPolicies** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteCustomRoutingEndpointTrafficPoliciesRequest
 * @return DeleteCustomRoutingEndpointTrafficPoliciesResponse
 */
async function deleteCustomRoutingEndpointTrafficPolicies(request: DeleteCustomRoutingEndpointTrafficPoliciesRequest): DeleteCustomRoutingEndpointTrafficPoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomRoutingEndpointTrafficPoliciesWithOptions(request, runtime);
}

model DeleteCustomRoutingEndpointsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint that you want to delete belongs.

This parameter is required.', example='epg-bp1bpn0kn908w4nb****'),
  endpointIds?: [ string ](name='EndpointIds', description='The IDs of endpoints to be deleted.

If you do not set this parameter, all the endpoints in the specified endpoint group are deleted.

You can specify at most 10 endpoint IDs.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteCustomRoutingEndpointsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteCustomRoutingEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomRoutingEndpointsResponseBody(name='body'),
}

/**
 * @summary Deletes endpoints from a custom routing listener.
 *
 * @description *   **DeleteCustomRoutingEndpoints** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) to query the status of the task.
 *     *   If an endpoint group is in the **updating** state, the endpoint is being deleted. In this case, you can perform only query operations.
 *     *   If an endpoint group is in the **active** state and the endpoint cannot be found after you call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation, the endpoint is deleted.
 * *   You cannot call the **DeleteCustomRoutingEndpoints** operation again on the same Global Accelerator (GA) instance before the previous task is completed.
 *
 * @param request DeleteCustomRoutingEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomRoutingEndpointsResponse
 */
async function deleteCustomRoutingEndpointsWithOptions(request: DeleteCustomRoutingEndpointsRequest, runtime: Util.RuntimeOptions): DeleteCustomRoutingEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointIds)) {
    query['EndpointIds'] = request.endpointIds;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomRoutingEndpoints',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes endpoints from a custom routing listener.
 *
 * @description *   **DeleteCustomRoutingEndpoints** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) to query the status of the task.
 *     *   If an endpoint group is in the **updating** state, the endpoint is being deleted. In this case, you can perform only query operations.
 *     *   If an endpoint group is in the **active** state and the endpoint cannot be found after you call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation, the endpoint is deleted.
 * *   You cannot call the **DeleteCustomRoutingEndpoints** operation again on the same Global Accelerator (GA) instance before the previous task is completed.
 *
 * @param request DeleteCustomRoutingEndpointsRequest
 * @return DeleteCustomRoutingEndpointsResponse
 */
async function deleteCustomRoutingEndpoints(request: DeleteCustomRoutingEndpointsRequest): DeleteCustomRoutingEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomRoutingEndpointsWithOptions(request, runtime);
}

model DeleteDomainAcceleratorRelationRequest {
  acceleratorIds?: [ string ](name='AcceleratorIds', description='The ID of the GA instance to be disassociated. You can specify up to 50 IDs.

If you leave this parameter empty, all GA instances associated with the specified domain name are disassociated.'),
  domain?: string(name='Domain', description='The accelerated domain name to be disassociated.

This parameter is required.', example='www.example.com'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model DeleteDomainAcceleratorRelationResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteDomainAcceleratorRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDomainAcceleratorRelationResponseBody(name='body'),
}

/**
 * @summary Disassociates a domain name from Global Accelerator (GA) instances.
 *
 * @description You cannot call the **DeleteDomainAcceleratorRelation** operation again by using the same Alibaba Cloud account before the previous operation is complete.
 *
 * @param request DeleteDomainAcceleratorRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDomainAcceleratorRelationResponse
 */
async function deleteDomainAcceleratorRelationWithOptions(request: DeleteDomainAcceleratorRelationRequest, runtime: Util.RuntimeOptions): DeleteDomainAcceleratorRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorIds)) {
    query['AcceleratorIds'] = request.acceleratorIds;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomainAcceleratorRelation',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a domain name from Global Accelerator (GA) instances.
 *
 * @description You cannot call the **DeleteDomainAcceleratorRelation** operation again by using the same Alibaba Cloud account before the previous operation is complete.
 *
 * @param request DeleteDomainAcceleratorRelationRequest
 * @return DeleteDomainAcceleratorRelationResponse
 */
async function deleteDomainAcceleratorRelation(request: DeleteDomainAcceleratorRelationRequest): DeleteDomainAcceleratorRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainAcceleratorRelationWithOptions(request, runtime);
}

model DeleteEndpointGroupRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group that you want to delete.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
}

model DeleteEndpointGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DeleteEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Deletes an endpoint group.
 *
 * @description *   **DeleteEndpointGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the status of the endpoint group.
 *     *   If the endpoint group is in the **deleting** state, it indicates that the endpoint group is being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint group cannot be queried, it indicates that the endpoint group is deleted.
 * *   The **DeleteEndpointGroup** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request DeleteEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEndpointGroupResponse
 */
async function deleteEndpointGroupWithOptions(request: DeleteEndpointGroupRequest, runtime: Util.RuntimeOptions): DeleteEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an endpoint group.
 *
 * @description *   **DeleteEndpointGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the status of the endpoint group.
 *     *   If the endpoint group is in the **deleting** state, it indicates that the endpoint group is being deleted. In this case, you can perform only query operations.
 *     *   If the endpoint group cannot be queried, it indicates that the endpoint group is deleted.
 * *   The **DeleteEndpointGroup** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request DeleteEndpointGroupRequest
 * @return DeleteEndpointGroupResponse
 */
async function deleteEndpointGroup(request: DeleteEndpointGroupRequest): DeleteEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEndpointGroupWithOptions(request, runtime);
}

model DeleteEndpointGroupsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of endpoint groups.

You can specify up to 10 endpoint group IDs in each request.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteEndpointGroupsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DeleteEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Deletes endpoint groups.
 *
 * @description *   **DeleteEndpointGroups** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the status of the task.
 *     *   If an endpoint group is in the **deleting** state, the endpoint group is being deleted. In this case, you can perform only query operations.
 *     *   If an endpoint group cannot be queried, the endpoint group is deleted.
 * *   The **DeleteEndpointGroups** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEndpointGroupsResponse
 */
async function deleteEndpointGroupsWithOptions(request: DeleteEndpointGroupsRequest, runtime: Util.RuntimeOptions): DeleteEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupIds)) {
    query['EndpointGroupIds'] = request.endpointGroupIds;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes endpoint groups.
 *
 * @description *   **DeleteEndpointGroups** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the status of the task.
 *     *   If an endpoint group is in the **deleting** state, the endpoint group is being deleted. In this case, you can perform only query operations.
 *     *   If an endpoint group cannot be queried, the endpoint group is deleted.
 * *   The **DeleteEndpointGroups** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteEndpointGroupsRequest
 * @return DeleteEndpointGroupsResponse
 */
async function deleteEndpointGroups(request: DeleteEndpointGroupsRequest): DeleteEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEndpointGroupsWithOptions(request, runtime);
}

model DeleteForwardingRulesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp17frjjh0udz4q****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  forwardingRuleIds?: [ string ](name='ForwardingRuleIds', description='The forwarding rules.

This parameter is required.', example='frule-bp19a3t3yzr21q3****'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsr-bp1s0vzbi5bxlx5****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteForwardingRulesResponseBody = {
  forwardingRules?: [ 
    {
      forwardingRuleId?: string(name='ForwardingRuleId', description='The forwarding rule ID.', example='frule-bp19a3t3yzr21q3****'),
    }
  ](name='ForwardingRules', description='The forwarding rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='CFC67ED9-4AB1-431F-B6E3-A752B7B8CCD4'),
}

model DeleteForwardingRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteForwardingRulesResponseBody(name='body'),
}

/**
 * @summary Deletes forwarding rules.
 *
 * @description *   **DeleteForwardingRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListForwardingRules](https://help.aliyun.com/document_detail/205817.html) operation to query the status of the task.
 *     *   If a forwarding rule is in the **deleting** state, the forwarding rule is being deleted. In this case, you can perform only query operations.
 *     *   If a forwarding rule cannot be queried, the forwarding rule is deleted.
 * *   The **DeleteForwardingRules** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteForwardingRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteForwardingRulesResponse
 */
async function deleteForwardingRulesWithOptions(request: DeleteForwardingRulesRequest, runtime: Util.RuntimeOptions): DeleteForwardingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forwardingRuleIds)) {
    query['ForwardingRuleIds'] = request.forwardingRuleIds;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteForwardingRules',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes forwarding rules.
 *
 * @description *   **DeleteForwardingRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListForwardingRules](https://help.aliyun.com/document_detail/205817.html) operation to query the status of the task.
 *     *   If a forwarding rule is in the **deleting** state, the forwarding rule is being deleted. In this case, you can perform only query operations.
 *     *   If a forwarding rule cannot be queried, the forwarding rule is deleted.
 * *   The **DeleteForwardingRules** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteForwardingRulesRequest
 * @return DeleteForwardingRulesResponse
 */
async function deleteForwardingRules(request: DeleteForwardingRulesRequest): DeleteForwardingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteForwardingRulesWithOptions(request, runtime);
}

model DeleteIpSetRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance for which you want to delete an acceleration region.', example='ga-bp1yeeq8yfoyszmqy****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='DD61839A-5CC5-404B-8C6E-56066F0C432D'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region that you want to delete.

You can call the [ListIpSets](https://help.aliyun.com/document_detail/2253273.html) operation to query the IDs of acceleration regions of a specified GA instance.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model DeleteIpSetResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='DD61839A-5CC5-404B-8C6E-56066F0C432D'),
}

model DeleteIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpSetResponseBody(name='body'),
}

/**
 * @summary Deletes an acceleration region.
 *
 * @description *   **DeleteIpSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of an acceleration region.
 *     *   If the acceleration region is in the **deleting** state, it indicates that the acceleration region is being deleted. In this case, you can perform only query operations.
 *     *   If the acceleration region cannot be queried, it indicates that the acceleration region is deleted.
 * *   The **DeleteIpSet** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request DeleteIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpSetResponse
 */
async function deleteIpSetWithOptions(request: DeleteIpSetRequest, runtime: Util.RuntimeOptions): DeleteIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an acceleration region.
 *
 * @description *   **DeleteIpSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of an acceleration region.
 *     *   If the acceleration region is in the **deleting** state, it indicates that the acceleration region is being deleted. In this case, you can perform only query operations.
 *     *   If the acceleration region cannot be queried, it indicates that the acceleration region is deleted.
 * *   The **DeleteIpSet** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request DeleteIpSetRequest
 * @return DeleteIpSetResponse
 */
async function deleteIpSet(request: DeleteIpSetRequest): DeleteIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpSetWithOptions(request, runtime);
}

model DeleteIpSetsRequest {
  ipSetIds?: [ string ](name='IpSetIds', description='The IDs of the acceleration regions that you want to delete.

This parameter is required.', example='ips-bp11c9mpphtb1xkds****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteIpSetsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='B49B60F6-F6C8-49E5-B06B-E33E3A469A92'),
}

model DeleteIpSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpSetsResponseBody(name='body'),
}

/**
 * @summary Deletes acceleration regions.
 *
 * @description *   **DeleteIpSets** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **deleting** state, the acceleration region is being deleted. In this case, you can perform only query operations.
 *     *   If you cannot query the acceleration region, the acceleration region is deleted.
 * *   You cannot repeatedly call the **DeleteIpSets** operation for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteIpSetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpSetsResponse
 */
async function deleteIpSetsWithOptions(request: DeleteIpSetsRequest, runtime: Util.RuntimeOptions): DeleteIpSetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipSetIds)) {
    query['IpSetIds'] = request.ipSetIds;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpSets',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes acceleration regions.
 *
 * @description *   **DeleteIpSets** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **deleting** state, the acceleration region is being deleted. In this case, you can perform only query operations.
 *     *   If you cannot query the acceleration region, the acceleration region is deleted.
 * *   You cannot repeatedly call the **DeleteIpSets** operation for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteIpSetsRequest
 * @return DeleteIpSetsResponse
 */
async function deleteIpSets(request: DeleteIpSetsRequest): DeleteIpSetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpSetsWithOptions(request, runtime);
}

model DeleteListenerRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance for which you want to delete a listener.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  listenerId?: string(name='ListenerId', description='The ID of the listener that you want to delete.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model DeleteListenerResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DeleteListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteListenerResponseBody(name='body'),
}

/**
 * @summary Deletes a listener.
 *
 * @description *   Before you call the **DeleteListener** operation, make sure that no endpoint groups are associated with the listener that you want to delete. For information about how to delete an endpoint group, see the following topics:
 *     *   [DeleteEndpointGroup](https://help.aliyun.com/document_detail/2253305.html): deletes an endpoint group that is associated with an intelligent routing listener.
 *     *   [DeleteEndpointGroups](https://help.aliyun.com/document_detail/2253311.html): deletes multiple endpoint groups that are associated with intelligent routing listeners at the same time.
 *     *   [DeleteCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/2303183.html): deletes multiple endpoint groups that are associated with custom routing listeners at the same time.
 * *   **DeleteListener** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of the listener.
 *     *   If the listener is in the **deleting** state, the listener is being deleted. In this case, you can perform only query operations.
 *     *   If the listener cannot be queried, the listener is deleted.
 * *   You cannot repeatedly call the **DeleteListener** operation to delete the listeners of the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteListenerResponse
 */
async function deleteListenerWithOptions(request: DeleteListenerRequest, runtime: Util.RuntimeOptions): DeleteListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a listener.
 *
 * @description *   Before you call the **DeleteListener** operation, make sure that no endpoint groups are associated with the listener that you want to delete. For information about how to delete an endpoint group, see the following topics:
 *     *   [DeleteEndpointGroup](https://help.aliyun.com/document_detail/2253305.html): deletes an endpoint group that is associated with an intelligent routing listener.
 *     *   [DeleteEndpointGroups](https://help.aliyun.com/document_detail/2253311.html): deletes multiple endpoint groups that are associated with intelligent routing listeners at the same time.
 *     *   [DeleteCustomRoutingEndpointGroups](https://help.aliyun.com/document_detail/2303183.html): deletes multiple endpoint groups that are associated with custom routing listeners at the same time.
 * *   **DeleteListener** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of the listener.
 *     *   If the listener is in the **deleting** state, the listener is being deleted. In this case, you can perform only query operations.
 *     *   If the listener cannot be queried, the listener is deleted.
 * *   You cannot repeatedly call the **DeleteListener** operation to delete the listeners of the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DeleteListenerRequest
 * @return DeleteListenerResponse
 */
async function deleteListener(request: DeleteListenerRequest): DeleteListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteListenerWithOptions(request, runtime);
}

model DeleteSpareIpsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true:** performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (defalut): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  spareIps?: [ string ](name='SpareIps', description='The secondary IP addresses to be deleted for the CNAME. If an acceleration area of the GA instance becomes unavailable, GA redirects the access traffic to the secondary IP addresses.

Separate the IP addresses with commas (,). You can specify up to two secondary IP addresses.

This parameter is required.'),
}

model DeleteSpareIpsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DeleteSpareIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSpareIpsResponseBody(name='body'),
}

/**
 * @summary Deletes the secondary IP addresses that are associated with a CNAME.
 *
 * @description *   **DeleteSpareIps** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that the secondary IP addresses for the CNAME are being deleted. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state and the secondary IP addresses for the CNAME cannot be queried by calling the [ListSpareIps](https://help.aliyun.com/document_detail/262121.html) operation, it indicates that the IP addresses are deleted.
 * *   The **DeleteSpareIps** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request DeleteSpareIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSpareIpsResponse
 */
async function deleteSpareIpsWithOptions(request: DeleteSpareIpsRequest, runtime: Util.RuntimeOptions): DeleteSpareIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.spareIps)) {
    query['SpareIps'] = request.spareIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSpareIps',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the secondary IP addresses that are associated with a CNAME.
 *
 * @description *   **DeleteSpareIps** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that the secondary IP addresses for the CNAME are being deleted. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state and the secondary IP addresses for the CNAME cannot be queried by calling the [ListSpareIps](https://help.aliyun.com/document_detail/262121.html) operation, it indicates that the IP addresses are deleted.
 * *   The **DeleteSpareIps** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request DeleteSpareIpsRequest
 * @return DeleteSpareIpsResponse
 */
async function deleteSpareIps(request: DeleteSpareIpsRequest): DeleteSpareIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSpareIpsWithOptions(request, runtime);
}

model DescribeAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance that you want to query.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', description='The region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAcceleratorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
  bandwidthBillingType?: string(name='BandwidthBillingType', description='The bandwidth metering method. Valid values:

*   **BandwidthPackage:** billed based on bandwidth plans.
*   **CDT**: billed based on data transfer.', example='CDT'),
  basicBandwidthPackage?: {
    bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the basic bandwidth plan. Unit: Mbit/s.', example='2'),
    bandwidthType?: string(name='BandwidthType', description='The type of the bandwidth that is provided by the basic bandwidth plan. Valid values:

*   **Basic**: basic
*   **Enhanced**: enhanced
*   **Advanced**: premium', example='Basic'),
    instanceId?: string(name='InstanceId', description='The ID of the basic bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
  }(name='BasicBandwidthPackage', description='The details about the basic bandwidth plan that is associated with the GA instance.'),
  cenId?: string(name='CenId', description='The ID of the Cloud Enterprise Network (CEN) instance with which the GA instance is associated.', example='cen-hjkduu767hc****'),
  createTime?: long(name='CreateTime', description='The timestamp that indicates when the GA instance is created.', example='1650643200'),
  crossBorderMode?: string(name='CrossBorderMode', description='The type of cross-border acceleration. This parameter is returned for GA instances whose bandwidth metering method is pay-by-data-transfer (CDT).

Only **bpgPro** may be returned, which indicates BGP (Multi-ISP) Pro lines.', example='bpgPro'),
  crossBorderStatus?: boolean(name='CrossBorderStatus', description='Indicates whether cross-border acceleration is enabled.
- **true**: yes
- **false**: no', example='false'),
  crossDomainBandwidthPackage?: {
    bandwidth?: int32(name='Bandwidth', description='The bandwidth that is provided by the cross-border acceleration bandwidth plan. Unit: Mbit/s.', example='2'),
    instanceId?: string(name='InstanceId', description='The ID of the cross-border acceleration bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
  }(name='CrossDomainBandwidthPackage', description='The details about the cross-border acceleration bandwidth plan that is associated with the GA instance.

This array is returned only for GA instances that are created on the international site (alibabacloud.com).'),
  crossPrivateState?: string(name='CrossPrivateState', description='Indicates whether cross-border acceleration is enabled.

*   **true**: yes
*   **false**: no', example='false'),
  ddosId?: string(name='DdosId', description='The ID of the Anti-DDoS Pro/Premium instance that is associated with the GA instance.', example='ddoscoo-cn-zz11vq7j****'),
  description?: string(name='Description', description='The description of the GA instance.', example='Accelerator'),
  dnsName?: string(name='DnsName', description='The canonical name (CNAME) that is assigned to the GA instance.', example='ga-bp15u1i2hmtbk8c3i****.aliyunga0019.com'),
  expiredTime?: long(name='ExpiredTime', description='The timestamp that indicates when the GA instance expires.', example='1653235200'),
  instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the GA instance.', example='PREPAY'),
  ipSetConfig?: {
    accessMode?: string(name='AccessMode', description='The access mode of the acceleration area. Valid values:

*   **UserDefine**: custom nearby access mode. You can select acceleration areas and regions based on your business requirements. GA allocates a separate elastic IP address (EIP) to each acceleration region.
*   **Anycast**: automatic nearby access mode. You do not need to specify an acceleration area. GA allocates an Anycast EIP to multiple regions across the globe. Users can connect to the nearest access point of the Alibaba Cloud global transmission network by sending requests to the Anycast EIP.', example='UserDefine'),
  }(name='IpSetConfig', description='The configurations of the acceleration area.'),
  name?: string(name='Name', description='The name of the GA instance.', example='Accelerator'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmw2vwdbujqbq'),
  secondDnsName?: string(name='SecondDnsName', description='The CNAME that is used to integrate the GA instance with the Anti-DDoS service.', example='ga-bp1f609c76zg6zuna****-1.aliyunga0047.com'),
  serviceId?: string(name='ServiceId', description='The ID of the service that manages the GA instance.

>  This parameter is returned only if the value of **ServiceManaged** is **true**.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='The name of the action performed on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
      childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: a listener.
*   **IpSet**: an acceleration region.
*   **EndpointGroup**: an endpoint group.
*   **ForwardingRule**: a forwarding rule.
*   **Endpoint**: an endpoint.
*   **EndpointGroupDestination**: a protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: a traffic policy of an endpoint associated with a custom routing listener.

>  This parameter is returned only if the value of **Action** is **CreateChild**.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and you cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and you can perform the specified actions on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='The actions that you can perform on the managed instance.

>  * This parameter is returned only if the value of **ServiceManaged** is **true**.
>*   You can perform only specific actions on a managed instance.'),
  spec?: string(name='Spec', description='The specification of the GA instance. Valid values:

*   **1**: Small Ⅰ
*   **2**: Small Ⅱ
*   **3**: Small Ⅲ
*   **5**: Medium Ⅰ
*   **8**: Medium Ⅱ
*   **10**: Medium Ⅲ
*   **20**: Large Ⅰ
*   **30**: Large Ⅱ
*   **40**: Large Ⅲ
*   **50**: Large Ⅳ
*   **60**: Large Ⅴ
*   **70**: Large Ⅵ
*   **80**: Large VⅡ
*   **90**: Large VⅢ
*   **100**: Super Large Ⅰ
*   **200**: Super Large Ⅱ

>  The Large Ⅲ specification and higher specifications are available only to users that are added to the whitelist. To use these specifications, contact your Alibaba Cloud account manager.

Different specifications provide different capabilities. For more information, see [Instance specifications](https://help.aliyun.com/document_detail/153127.html).', example='1'),
  state?: string(name='State', description='The status of the GA instance. Valid values:

*   **init**: The GA instance is being initialized.
*   **active**: The GA instance is available.
*   **configuring**: The GA instance is being configured.
*   **binding**: The GA instance is being associated.
*   **unbinding**: The GA instance is being disassociated.
*   **deleting**: The GA instance is being deleted.
*   **finacialLocked**: The GA instance is locked due to overdue payments.', example='active'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of tag N that is added to the GA instance.', example='tag-key'),
      value?: string(name='Value', description='The value of tag N that is added to the GA instance.', example='tag-value'),
    }
  ](name='Tags', description='The tags of the GA instance.'),
  upgradableStatus?: string(name='UpgradableStatus', description='Indicates whether the GA instance can be upgraded. Valid values:

*   **notUpgradable:** The GA instance does not need to be upgraded.
*   **upgradable:** The GA instance can be upgraded to the latest version.
*   **upgradeFailed:** The GA instance failed to be upgraded.', example='notUpgradable'),
}

model DescribeAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAcceleratorResponseBody(name='body'),
}

/**
 * @summary Queries information about a Global Accelerator (GA) instance.
 *
 * @param request DescribeAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAcceleratorResponse
 */
async function describeAcceleratorWithOptions(request: DescribeAcceleratorRequest, runtime: Util.RuntimeOptions): DescribeAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about a Global Accelerator (GA) instance.
 *
 * @param request DescribeAcceleratorRequest
 * @return DescribeAcceleratorResponse
 */
async function describeAccelerator(request: DescribeAcceleratorRequest): DescribeAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAcceleratorWithOptions(request, runtime);
}

model DescribeAcceleratorAutoRenewAttributeRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAcceleratorAutoRenewAttributeResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp17frjjh0udz4qz****'),
  autoRenew?: boolean(name='AutoRenew', description='Indicates whether auto-renewal is enabled. Valid values:

*   **true**
*   **false**', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: month.', example='1'),
  renewalStatus?: string(name='RenewalStatus', description='Indicates how the GA instance is renewed. Valid values:

*   **AutoRenewal**: The GA instance is automatically renewed.
*   **Normal**: You must manually renew the GA instance.
*   **NotRenewal**: The GA instance is not renewed after it expires. The system sends only a non-renewal reminder three days before the expiration date. The system no longer sends notifications to remind you to renew the GA instance.', example='Normal'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model DescribeAcceleratorAutoRenewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAcceleratorAutoRenewAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the auto-renewal status of a Global Accelerator (GA) instance.
 *
 * @param request DescribeAcceleratorAutoRenewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAcceleratorAutoRenewAttributeResponse
 */
async function describeAcceleratorAutoRenewAttributeWithOptions(request: DescribeAcceleratorAutoRenewAttributeRequest, runtime: Util.RuntimeOptions): DescribeAcceleratorAutoRenewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAcceleratorAutoRenewAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the auto-renewal status of a Global Accelerator (GA) instance.
 *
 * @param request DescribeAcceleratorAutoRenewAttributeRequest
 * @return DescribeAcceleratorAutoRenewAttributeResponse
 */
async function describeAcceleratorAutoRenewAttribute(request: DescribeAcceleratorAutoRenewAttributeRequest): DescribeAcceleratorAutoRenewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAcceleratorAutoRenewAttributeWithOptions(request, runtime);
}

model DescribeAcceleratorServiceStatusRequest {
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to cn-hangzhou.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAcceleratorServiceStatusResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  status?: string(name='Status', description='The status of the GA instance. Valid values:

*   Released: The instance was released due to overdue payments.
*   Expired: The instance expired due to overdue payments.
*   NotOpened: The instance is not activated.
*   Normal: The instance is activated.', example='Normal'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values: true false', example='True'),
}

model DescribeAcceleratorServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAcceleratorServiceStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of a pay-as-you-go Global Accelerator (GA) instance.
 *
 * @param request DescribeAcceleratorServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAcceleratorServiceStatusResponse
 */
async function describeAcceleratorServiceStatusWithOptions(request: DescribeAcceleratorServiceStatusRequest, runtime: Util.RuntimeOptions): DescribeAcceleratorServiceStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAcceleratorServiceStatus',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of a pay-as-you-go Global Accelerator (GA) instance.
 *
 * @param request DescribeAcceleratorServiceStatusRequest
 * @return DescribeAcceleratorServiceStatusResponse
 */
async function describeAcceleratorServiceStatus(request: DescribeAcceleratorServiceStatusRequest): DescribeAcceleratorServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAcceleratorServiceStatusWithOptions(request, runtime);
}

model DescribeApplicationMonitorRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task.

This parameter is required.', example='sm-bp1fpdjfju9k8yr1y****'),
}

model DescribeApplicationMonitorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance on which the origin probing task ran.', example='ga-bp1odcab8tmno0hdq****'),
  address?: string(name='Address', description='The URL or IP address that was probed.', example='https://www.aliyun.com'),
  detectEnable?: boolean(name='DetectEnable', description='Indicates whether the automatic diagnostics feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
  detectThreshold?: int32(name='DetectThreshold', description='The threshold that is used to trigger automatic diagnostics.

If the availability of the origin server drops below the specified threshold, the automatic diagnostics feature is triggered.', example='0'),
  detectTimes?: int32(name='DetectTimes', description='The number of times that are required to reach the threshold before the automatic diagnostics feature is triggered.', example='1'),
  ispCityList?: [ 
    {
      city?: string(name='City', description='The ID of the city in which the probe point of the ISP is deployed.', example='375'),
      cityName?: string(name='CityName', description='The name of the city in which the probe point of the ISP is deployed.', example='Singapore'),
      isp?: string(name='Isp', description='The probe point ID of the ISP.', example='465'),
      ispName?: string(name='IspName', description='The probe point name of the ISP.', example='Alibaba'),
    }
  ](name='IspCityList', description='The probe points of the Internet service provider (ISP).'),
  listenerId?: string(name='ListenerId', description='The ID of the listener on which the origin probing task ran.', example='lsr-bp1bpn0kn908w4nbw****'),
  optionsJson?: string(name='OptionsJson', description='The extended options of the listener protocol that is used by the origin probing task. The options vary based on the listener protocol.', example='{ "http_method": "get","header": "key:asd","acceptable_response_code": "500","cert_verify": true }'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  silenceTime?: int32(name='SilenceTime', description='The silence period of the automatic diagnostics feature. This parameter indicates the interval at which the automatic diagnostics feature is triggered. If the availability rate does not return to normal after GA triggers automatic diagnostics, GA must wait until the silence period ends before GA can trigger another automatic diagnostic.

If the number of consecutive times that the availability rate drops below the automatic diagnostics threshold reaches the value of **DetectTimes**, the automatic diagnostics feature is triggered. The automatic diagnostics feature is not triggered again within the silence period regardless of whether the availability rate remains below the threshold. If the availability rate does not return to normal after the silence period ends, the automatic diagnostics feature is triggered again.

Unit: seconds.', example='300'),
  state?: string(name='State', description='The status of the origin probing task. Valid values:

*   **init**
*   **active**
*   **updating**
*   **inactive**
*   **deleting**', example='active'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task.', example='sm-bp1fpdjfju9k8yr1y****'),
  taskName?: string(name='TaskName', description='The name of the origin probing task.', example='task1'),
}

model DescribeApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Queries the detailed information about an origin probing task.
 *
 * @param request DescribeApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationMonitorResponse
 */
async function describeApplicationMonitorWithOptions(request: DescribeApplicationMonitorRequest, runtime: Util.RuntimeOptions): DescribeApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the detailed information about an origin probing task.
 *
 * @param request DescribeApplicationMonitorRequest
 * @return DescribeApplicationMonitorResponse
 */
async function describeApplicationMonitor(request: DescribeApplicationMonitorRequest): DescribeApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApplicationMonitorWithOptions(request, runtime);
}

model DescribeBandwidthPackageRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan that you want to query.

This parameter is required.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeBandwidthPackageResponseBody = {
  accelerators?: [ string ](name='Accelerators', description='The ID of the GA instance that is associated with the bandwidth plan.'),
  bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the bandwidth plan. Unit: Mbit/s.', example='2'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  bandwidthType?: string(name='BandwidthType', description='The type of the bandwidth. Valid values:

*   **Basic**: basic bandwidth
*   **Enhanced**: enhanced bandwidth
*   **Advanced**: premium bandwidth', example='Basic'),
  billingType?: string(name='BillingType', description='The metering method that is used when you use the pay-as-you-go billing method. Valid values:

*   **PayByTraffic**: pay-by-data-transfer
*   **PayBY95**: pay-by-95th-percentile', example='PayByTraffic'),
  cbnGeographicRegionIdA?: string(name='CbnGeographicRegionIdA', description='Area A specified in the cross-region acceleration bandwidth plan. Only **China-mainland** (the Chinese mainland) is returned.

This parameter is returned only if you call this operation on the International site (alibabacloud.com).', example='China-mainland'),
  cbnGeographicRegionIdB?: string(name='CbnGeographicRegionIdB', description='Area B specified in the cross-region acceleration bandwidth plan. Only **Global** (global) is returned.

This parameter is returned only if you call this operation on the International site (alibabacloud.com).', example='Global'),
  chargeType?: string(name='ChargeType', description='The billing method of the bandwidth plan.

*   **PREPAY**: subscription. This is the default value.
*   **POSTPAY**: pay-as-you-go.', example='PREPAY'),
  createTime?: string(name='CreateTime', description='The timestamp that indicates when the bandwidth plan was created.', example='1578966918000'),
  description?: string(name='Description', description='The description of the bandwidth plan.', example='testDescription'),
  expiredTime?: string(name='ExpiredTime', description='The timestamp that indicates when the bandwidth plan expires.', example='1578966918000'),
  name?: string(name='Name', description='The name of the bandwidth plan.', example='testName'),
  ratio?: int32(name='Ratio', description='The percentage of the minimum bandwidth guaranteed if the pay-by-95th-percentile-bandwidth metering method is used. Valid values: **30** to **100**.', example='30'),
  regionId?: string(name='RegionId', description='The ID of the region where GA instance is deployed. **cn-hangzhou** is returned.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4B6DBBB0-2D01-4C6A-A384-4129266E6B78'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfnvueepcihjiq'),
  state?: string(name='State', description='The state of the bandwidth plan. Valid values:

*   **init**: The bandwidth plan is being initialized.
*   **active**: The bandwidth plan is available.
*   **binded**: The bandwidth plan is associated with a GA instance.
*   **binding**: The bandwidth plan is being associated.
*   **unbinding**: The bandwidth plan is being disassociated.
*   **updating**: The bandwidth plan is being updated.
*   **finacialLocked**: The bandwidth plan is locked due to overdue payments.
*   **Locked**: The bandwidth plan is locked.', example='active'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of tag N that is added to the bandwidth plan.', example='tag-key'),
      value?: string(name='Value', description='The value of tag N that is added to the bandwidth plan.', example='tag-value'),
    }
  ](name='Tags', description='Tag objects.'),
  type?: string(name='Type', description='The type of the bandwidth plan. Valid values:

*   **Basic**: a basic bandwidth plan
*   **CrossDomain**: a cross-region acceleration bandwidth plan

If you call this operation on the Alibaba Cloud China Site (aliyun.com), only **Basic** is returned.', example='Basic'),
}

model DescribeBandwidthPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBandwidthPackageResponseBody(name='body'),
}

/**
 * @summary Queries information about a bandwidth plan.
 *
 * @param request DescribeBandwidthPackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBandwidthPackageResponse
 */
async function describeBandwidthPackageWithOptions(request: DescribeBandwidthPackageRequest, runtime: Util.RuntimeOptions): DescribeBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBandwidthPackage',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about a bandwidth plan.
 *
 * @param request DescribeBandwidthPackageRequest
 * @return DescribeBandwidthPackageResponse
 */
async function describeBandwidthPackage(request: DescribeBandwidthPackageRequest): DescribeBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBandwidthPackageWithOptions(request, runtime);
}

model DescribeBandwidthPackageAutoRenewAttributeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the bandwidth plan.

This parameter is required.', example='gbwp-bp1iquvlp8khla5emb3ia'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to cn-hangzhou.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeBandwidthPackageAutoRenewAttributeResponseBody = {
  autoRenew?: boolean(name='AutoRenew', description='Indicates whether auto-renewal is enabled.

*   **true**
*   **false** (default)', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: month. Valid values: **1** to **12**.

>  This parameter is returned only if the value of **AutoRenew** is **true**.', example='1'),
  instanceId?: string(name='InstanceId', description='The ID of the bandwidth plan.', example='gbwp-bp1iquvlp8khla5emb3ia'),
  renewalStatus?: string(name='RenewalStatus', description='The auto-renewal status of the bandwidth plan.

*   **AutoRenewal**: The bandwidth plan is automatically renewed.
*   **Normal**: You must manually renew the bandwidth plan.
*   **NotRenewal**: The bandwidth plan is not renewed after it expires. The system sends a non-renewal reminder three days before the expiration date but no longer sends reminders to renew the bandwidth plan. You can change the auto-renewal status of a bandwidth plan from NotRenewal to **Normal** or **AutoRenewal**.

>  **RenewalStatus** takes precedence over **AutoRenew**. If you do not specify **RenewalStatus**, **AutoRenew** is automatically used.', example='Normal'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B820E9F9-D459-5AE7-8F08-A368B53C1AC3'),
}

model DescribeBandwidthPackageAutoRenewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBandwidthPackageAutoRenewAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the auto-renewal status of a bandwidth plan.
 *
 * @param request DescribeBandwidthPackageAutoRenewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBandwidthPackageAutoRenewAttributeResponse
 */
async function describeBandwidthPackageAutoRenewAttributeWithOptions(request: DescribeBandwidthPackageAutoRenewAttributeRequest, runtime: Util.RuntimeOptions): DescribeBandwidthPackageAutoRenewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBandwidthPackageAutoRenewAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the auto-renewal status of a bandwidth plan.
 *
 * @param request DescribeBandwidthPackageAutoRenewAttributeRequest
 * @return DescribeBandwidthPackageAutoRenewAttributeResponse
 */
async function describeBandwidthPackageAutoRenewAttribute(request: DescribeBandwidthPackageAutoRenewAttributeRequest): DescribeBandwidthPackageAutoRenewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBandwidthPackageAutoRenewAttributeWithOptions(request, runtime);
}

model DescribeCommodityRequest {
  commodityCode?: string(name='CommodityCode', description='The commodity code.

Valid values on the China site (aliyun.com):

*   **ga_gapluspre_public_cn**: GA instance.
*   **ga_plusbwppre_public_cn**: basic bandwidth plan.

Valid values on the international site (alibabacloud.com):

*   **ga_pluspre_public_intl**: GA instance.
*   **ga_bwppreintl_public_intl:** basic bandwidth plan.

This parameter is required.', example='ga_gapluspre_public_cn'),
  orderType?: string(name='OrderType', description='The type of the order. Valid values:

*   **BUY**: purchase order.
*   **RENEW**: renewal order.
*   **UPGRADE**: upgrade order.

This parameter is required.', example='BUY'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeCommodityResponseBody = {
  commodityCode?: string(name='CommodityCode', description='The commodity code.

Examples for the China site (aliyun.com):

*   **ga_gapluspre_public_cn**: GA instance.
*   **ga_plusbwppre_public_cn**: basic bandwidth plan.

Examples for the international site (alibabacloud.com):

*   **ga_pluspre_public_intl**: GA instance.
*   **ga_bwppreintl_public_intl**: basic bandwidth plan.', example='ga_gapluspre_public_cn'),
  commodityName?: string(name='CommodityName', description='The name of the commodity.', example='Global Accelerator_Instance Type (Subscription)'),
  components?: [ 
    {
      componentCode?: string(name='ComponentCode', description='The code of the commodity module.

The returned information varies based on the commodity module.', example='Duration'),
      componentName?: string(name='ComponentName', description='The name of the commodity module.

The returned information varies based on the commodity module.', example='Duration'),
      properties?: [ 
        {
          code?: string(name='Code', description='The code of the attribute.

The returned information varies based on the commodity module.', example='ord_time'),
          name?: string(name='Name', description='The name of the attribute.

The returned information varies based on the commodity module.', example='Duration'),
          propertyValueList?: [ 
            {
              orderIndex?: long(name='OrderIndex', description='The sequence number of the attribute.

The returned information varies based on the commodity module.', example='1'),
              text?: string(name='Text', description='The content of the attribute.

The returned information varies based on the commodity module.', example='1 Month'),
              tips?: string(name='Tips', description='The message of the attribute.

The returned information varies based on the commodity module.', example='1 Month'),
              value?: string(name='Value', description='The value of the attribute.

The returned information varies based on the commodity module.', example='1:Month'),
            }
          ](name='PropertyValueList', description='The list of attribute values of the commodity module.

The returned information varies based on the commodity module.'),
        }
      ](name='Properties', description='The attributes of the commodity module.

The returned information varies based on the commodity module.'),
    }
  ](name='Components', description='The information about the commodity modules.

The returned information varies based on the commodity.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DescribeCommodityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCommodityResponseBody(name='body'),
}

/**
 * @summary Queries information about commodities.
 *
 * @param request DescribeCommodityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCommodityResponse
 */
async function describeCommodityWithOptions(request: DescribeCommodityRequest, runtime: Util.RuntimeOptions): DescribeCommodityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.commodityCode)) {
    query['CommodityCode'] = request.commodityCode;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCommodity',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about commodities.
 *
 * @param request DescribeCommodityRequest
 * @return DescribeCommodityResponse
 */
async function describeCommodity(request: DescribeCommodityRequest): DescribeCommodityResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCommodityWithOptions(request, runtime);
}

model DescribeCommodityPriceRequest {
  orders?: [ 
    {
      chargeType?: string(name='ChargeType', description='The billing method. Set the value to **PREPAY**, which specifies the subscription billing method.', example='PREPAY'),
      commodityCode?: string(name='CommodityCode', description='The commodity code.

Valid values on the China site (aliyun.com):

*   **ga_gapluspre_public_cn**: GA instance.
*   **ga_plusbwppre_public_cn**: basic bandwidth plan.

Valid values on the international site (alibabacloud.com):

*   **ga_pluspre_public_intl**: GA instance.
*   **ga_bwppreintl_public_intl:** basic bandwidth plan.', example='ga_gapluspre_public_cn'),
      components?: [ 
        {
          componentCode?: string(name='ComponentCode', description='The code of the commodity module.

The information varies based on the commodity module. Examples: **instance** (GA instance) and **ord_time** (subscription duration).', example='instance'),
          properties?: [ 
            {
              code?: string(name='Code', description='The code of the attribute of the commodity module.

The information varies based on the commodity module. Examples: **instance** (GA instance) and **ord_time** (subscription duration).', example='instance'),
              value?: string(name='Value', description='The value of the attribute.

The information varies based on the commodity module. Examples: **instance_fee** (GA instance fee) and **1:Month** (one-month subscription).', example='instance_fee'),
            }
          ](name='Properties', description='The attributes of commodity modules.

The information varies based on the commodity module.'),
        }
      ](name='Components', description='The information about commodity modules.

The information varies based on the commodity module.'),
      duration?: long(name='Duration', description='The subscription duration.

*   Valid values if you set **PricingCycle** to **Month**: **1** to **9**.
*   Valid values if you set **PricingCycle** to **Year**: **1** to **3**.', example='1'),
      orderType?: string(name='OrderType', description='The type of the order. Valid values:

*   **BUY**: purchase order.
*   **RENEW**: renewal order.
*   **UPGRADE**: upgrade order.', example='BUY'),
      pricingCycle?: string(name='PricingCycle', description='The billing cycle. Valid values:

*   **Month**
*   **Year**', example='Month'),
      quantity?: long(name='Quantity', description='The number of instances that you want to purchase.', example='1'),
    }
  ](name='Orders', description='The commodity orders.

This parameter is required.'),
  promotionOptionNo?: string(name='PromotionOptionNo', description='The coupon code.

>  This parameter is unavailable on the China site (aliyun.com).', example='50003298014****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeCommodityPriceResponseBody = {
  currency?: string(name='Currency', description='The currency unit.

*   China site: **CNY**.
*   International site: **USD**.', example='CNY'),
  discountPrice?: double(name='DiscountPrice', description='The discount.', example='419.8'),
  orderDetails?: [ 
    {
      commodityCode?: string(name='CommodityCode', description='The code of the commodity.', example='ga_gapluspre_public_cn'),
      commodityName?: string(name='CommodityName', description='The name of the commodity.', example='Global Accelerator_Instance Type (Subscription)'),
      discountPrice?: double(name='DiscountPrice', description='The discount.', example='419.8'),
      moduleDetails?: [ 
        {
          discountPrice?: double(name='DiscountPrice', description='The discount.', example='40000.0'),
          moduleCode?: string(name='ModuleCode', description='The code of the commodity module.', example='spec'),
          moduleName?: string(name='ModuleName', description='The name of the commodity module.', example='Specification'),
          originalPrice?: double(name='OriginalPrice', description='The original price.', example='200000.0'),
          tradePrice?: double(name='TradePrice', description='The transaction price, which is equal to the original price minus the discount.', example='160000.0'),
        }
      ](name='ModuleDetails', description='The information about the commodity module.'),
      originalPrice?: double(name='OriginalPrice', description='The original price.', example='2099'),
      promDetails?: [ 
        {
          finalPromFee?: double(name='FinalPromFee', description='The discounted price.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='0.01'),
          optionCode?: string(name='OptionCode', description='The code of the discount option.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='youhui_quan'),
          promType?: string(name='PromType', description='The sub-type of the discount.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='deduct'),
          promotionId?: string(name='PromotionId', description='The ID of the discount item.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='50003298014****'),
          promotionName?: string(name='PromotionName', description='The name of the discount item.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='coupon'),
        }
      ](name='PromDetails', description='The details of the discount.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).'),
      quantity?: long(name='Quantity', description='The number of instances that are purchased.', example='1'),
      ruleIds?: [ long ](name='RuleIds', description='The IDs of discount rules.'),
      tradePrice?: double(name='TradePrice', description='The transaction price, which is equal to the original price minus the discount.', example='1679.2'),
    }
  ](name='OrderDetails', description='The details of the commodity module.'),
  originalPrice?: double(name='OriginalPrice', description='The original price.', example='2099'),
  promotions?: [ 
    {
      canPromFee?: double(name='CanPromFee', description='The discounted amount.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='0'),
      optionCode?: string(name='OptionCode', description='The code of the commodity to which the coupon can be applied.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='youhui_quan'),
      promotionName?: string(name='PromotionName', description='The name of the coupon.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='youhuiquan_promotion_option_id_for_blank'),
      promotionOptionNo?: string(name='PromotionOptionNo', description='The code of the coupon.
> *   `youhuiquan_promotion_option_id_for_blank` indicates coupons that cannot be applied to the commodity.
> *   This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='50003298014****'),
      selected?: boolean(name='Selected', description='Indicates whether the coupon was selected.

*   **true**
*   **false**

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).', example='false'),
    }
  ](name='Promotions', description='The details of the coupon.

>  This parameter does not take effect for accounts registered on the China site (aliyun.com).'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  ruleDetails?: [ 
    {
      ruleId?: string(name='RuleId', description='The ID of the discount rule.', example='102104100786****'),
      ruleName?: string(name='RuleName', description='The name of the discount rule.', example='GA New Customers Small II Specification Monthly Subscription - 20% Discount'),
    }
  ](name='RuleDetails', description='The details about the discount rules.'),
  tradePrice?: double(name='TradePrice', description='The transaction price, which is equal to the original price minus the discount.', example='1679.2'),
}

model DescribeCommodityPriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCommodityPriceResponseBody(name='body'),
}

/**
 * @summary Queries the prices of commodities.
 *
 * @description You can call the [DescribeCommodity](https://help.aliyun.com/document_detail/2253233.html) operation to query information about the commodity modules.
 *
 * @param request DescribeCommodityPriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCommodityPriceResponse
 */
async function describeCommodityPriceWithOptions(request: DescribeCommodityPriceRequest, runtime: Util.RuntimeOptions): DescribeCommodityPriceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orders)) {
    query['Orders'] = request.orders;
  }
  if (!Util.isUnset(request.promotionOptionNo)) {
    query['PromotionOptionNo'] = request.promotionOptionNo;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCommodityPrice',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the prices of commodities.
 *
 * @description You can call the [DescribeCommodity](https://help.aliyun.com/document_detail/2253233.html) operation to query information about the commodity modules.
 *
 * @param request DescribeCommodityPriceRequest
 * @return DescribeCommodityPriceResponse
 */
async function describeCommodityPrice(request: DescribeCommodityPriceRequest): DescribeCommodityPriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCommodityPriceWithOptions(request, runtime);
}

model DescribeCustomRoutingEndPointTrafficPolicyRequest {
  endpointId?: string(name='EndpointId', description='The ID of the traffic policy to be queried.', example='ep-bp1d2utp8qqe2a44t****'),
  policyId?: string(name='PolicyId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='ply-bptest2****'),
  regionId?: string(name='RegionId', description='The operation that you want to perform. Set the value to **DescribeCustomRoutingEndPointTrafficPolicy**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeCustomRoutingEndPointTrafficPolicyResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the request.', example='ga-bp1odcab8tmno0hdq****'),
  address?: string(name='Address', description='The ID of the traffic policy.', example='10.0.XX.XX'),
  endpoint?: string(name='Endpoint', description='The ID of the endpoint to which the traffic policy belongs.', example='vsw-test01'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the listener to which the endpoint belongs.', example='epg-bp1bpn0kn908w4nb****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint group to which the endpoint belongs.', example='ep-2zewuzypq5e6r3pfh****'),
  listenerId?: string(name='ListenerId', description='The ID of the GA instance to which the endpoint belongs.', example='lsr-bp1bpn0kn908w4nbw****'),
  policyId?: string(name='PolicyId', description='The name of the vSwitch to which the traffic policy belongs.', example='ply-bptest2****'),
  portRanges?: [ 
    {
      fromPort?: int32(name='FromPort', description='The first port of the port range used by the traffic destination to process requests.', example='80'),
      toPort?: int32(name='ToPort', description='The last port of the port range used by the traffic destination to process requests.', example='80'),
    }
  ](name='PortRanges', description='The IP address of the traffic policy.'),
  requestId?: string(name='RequestId', description='The ID of the endpoint to which the traffic destination belongs.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter is returned only if the value of **ServiceManaged** is **true**.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='The name of the action performed on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
      childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group that is associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint that is associated with a custom routing listener.

>  This parameter takes effect only if the value of **Action** is **CreateChild**.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.
> *   This parameter is returned only if the value of **ServiceManaged** is **true**.
> *   Users can perform only specific actions on a managed instance.'),
  state?: string(name='State', description='The status of the traffic destination.

- init: being initialized.
- active: running as expected.
- updating: being updated.
- deleting: being deleted.', example='active'),
}

model DescribeCustomRoutingEndPointTrafficPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomRoutingEndPointTrafficPolicyResponseBody(name='body'),
}

/**
 * @summary Queries a traffic destination of an endpoint.
 *
 * @param request DescribeCustomRoutingEndPointTrafficPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomRoutingEndPointTrafficPolicyResponse
 */
async function describeCustomRoutingEndPointTrafficPolicyWithOptions(request: DescribeCustomRoutingEndPointTrafficPolicyRequest, runtime: Util.RuntimeOptions): DescribeCustomRoutingEndPointTrafficPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.policyId)) {
    query['PolicyId'] = request.policyId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomRoutingEndPointTrafficPolicy',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a traffic destination of an endpoint.
 *
 * @param request DescribeCustomRoutingEndPointTrafficPolicyRequest
 * @return DescribeCustomRoutingEndPointTrafficPolicyResponse
 */
async function describeCustomRoutingEndPointTrafficPolicy(request: DescribeCustomRoutingEndPointTrafficPolicyRequest): DescribeCustomRoutingEndPointTrafficPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomRoutingEndPointTrafficPolicyWithOptions(request, runtime);
}

model DescribeCustomRoutingEndpointRequest {
  endpointGroup?: string(name='EndpointGroup', description='The ID of the endpoint group.', example='epg-bp1j184jhb9i9ubwf****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.

This parameter is required.', example='ep-bp1dmlohjjz4kqaun****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeCustomRoutingEndpointResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance with which the endpoint is associated.', example='ga-bp1odcab8tmno0hdq****'),
  endpoint?: string(name='Endpoint', description='The name of the endpoint (vSwitch).', example='vsw-test01'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint belongs.', example='epg-bp14sz7ftcwwjgrdm****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp1dmlohjjz4kqaun****'),
  listenerId?: string(name='ListenerId', description='The ID of the listener with which the endpoint is associated.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='String	04F0F334-1335-436C-A1D7-6C044FE73368'),
  serviceId?: string(name='ServiceId', description='The service ID to which the managed instance belongs.

>  Valid only when the ServiceManaged parameter is True.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Is it a managed instance. Valid values:

- true
- false', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='Managed policy action name, Valid values:

- Create
- Update
- Delete
- Associate
- UserUnmanaged
- CreateChild', example='Update'),
      childType?: string(name='ChildType', description='Sub resource type, Valid values:

- Listener
- IpSet
- EndpointGroup
- ForwardingRule
- Endpoint
- EndpointGroupDestination
- EndpointPolicy

>Only valid when the Action parameter is CreateChild.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Is the managed policy action managed, Valid values:

- true: The managed policy action is managed, and users do not have permission to perform the operation specified in the Action on the managed instance.

- false: The managed policy action is not managed, and users have permission to perform the operation specified in the Action on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='A list of action policies that users can execute on this managed instance.'),
  state?: string(name='State', description='The status of the endpoint.', example='active'),
  trafficToEndpointPolicy?: string(name='TrafficToEndpointPolicy', description='The access policy of traffic for the specified endpoint. Valid values:

*   **AllowAll**: allows all traffic to the endpoint.
*   **DenyAll**: denies all traffic to the endpoint.
*   **AllowCustom**: allows traffic only to specified destinations.', example='DenyAll'),
  type?: string(name='Type', description='The backend service type of the endpoint.

Set the value to **PrivateSubNet**, which indicates private CIDR blocks.', example='PrivateSubNet'),
}

model DescribeCustomRoutingEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomRoutingEndpointResponseBody(name='body'),
}

/**
 * @summary Queries a specified endpoint that is associated with a custom routing listener.
 *
 * @param request DescribeCustomRoutingEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomRoutingEndpointResponse
 */
async function describeCustomRoutingEndpointWithOptions(request: DescribeCustomRoutingEndpointRequest, runtime: Util.RuntimeOptions): DescribeCustomRoutingEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointGroup)) {
    query['EndpointGroup'] = request.endpointGroup;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomRoutingEndpoint',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a specified endpoint that is associated with a custom routing listener.
 *
 * @param request DescribeCustomRoutingEndpointRequest
 * @return DescribeCustomRoutingEndpointResponse
 */
async function describeCustomRoutingEndpoint(request: DescribeCustomRoutingEndpointRequest): DescribeCustomRoutingEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomRoutingEndpointWithOptions(request, runtime);
}

model DescribeCustomRoutingEndpointGroupRequest {
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaua****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeCustomRoutingEndpointGroupResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.', example='ga-bp1odcab8tmno0hdq****'),
  accessLogSwitch?: string(name='AccessLogSwitch', description='Indicates the status of the binding between the Log Service project and the endpoint group. Valid values:

*   **on:** The endpoint group is bound to the Log Service project.
*   **off:** The endpoint group is not bound to the Log Service project.
*   **binding:** The endpoint group is being bound to the Log Service project.
*   **unbinding:** The endpoint group is being unbound from the Log Service project.', example='on'),
  description?: string(name='Description', description='The description of the endpoint group.', example='EndpointGroup'),
  enableAccessLog?: boolean(name='EnableAccessLog', description='Indicates whether the access log feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
  endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.', example='epg-bp1dmlohjjz4kqaua****'),
  endpointGroupIpList?: [ string ](name='EndpointGroupIpList', description='The endpoint group IP addresses.'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The region ID of the endpoint group.', example='cn-hangzhou'),
  endpointGroupUnconfirmedIpList?: [ string ](name='EndpointGroupUnconfirmedIpList', description='The endpoint group IP addresses that need to be confirmed after the GA instance is upgraded.'),
  listenerId?: string(name='ListenerId', description='The custom routing listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
  name?: string(name='Name', description='The name of the endpoint group.', example='group1'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  serviceId?: string(name='ServiceId', description='The ID of the service that manages the GA instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
      childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener
*   **IpSet**: acceleration region
*   **EndpointGroup**: endpoint group
*   **ForwardingRule**: forwarding rule
*   **Endpoint**: endpoint
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener

>  This parameter takes effect only if **Action** is set to **CreateChild**.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.

*   Users can perform only specific actions on a managed instance.'),
  slsLogStoreName?: string(name='SlsLogStoreName', description='The name of the Logstore.', example='lsn-01'),
  slsProjectName?: string(name='SlsProjectName', description='The name of the Log Service project.', example='pn-01'),
  slsRegion?: string(name='SlsRegion', description='The region of the logs that are created in Log Service.', example='cn-hangzhou'),
  state?: string(name='State', description='The status of the endpoint group. Valid values:

*   **init:** The endpoint group is being initialized.
*   **active:** The endpoint group is running normally.
*   **updating:** The endpoint group is being updated.
*   **deleting:** The ACL is being deleted.', example='active'),
}

model DescribeCustomRoutingEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomRoutingEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Queries the information about a specific endpoint group that is associated with a custom routing listener.
 *
 * @param request DescribeCustomRoutingEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomRoutingEndpointGroupResponse
 */
async function describeCustomRoutingEndpointGroupWithOptions(request: DescribeCustomRoutingEndpointGroupRequest, runtime: Util.RuntimeOptions): DescribeCustomRoutingEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomRoutingEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a specific endpoint group that is associated with a custom routing listener.
 *
 * @param request DescribeCustomRoutingEndpointGroupRequest
 * @return DescribeCustomRoutingEndpointGroupResponse
 */
async function describeCustomRoutingEndpointGroup(request: DescribeCustomRoutingEndpointGroupRequest): DescribeCustomRoutingEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomRoutingEndpointGroupWithOptions(request, runtime);
}

model DescribeCustomRoutingEndpointGroupDestinationsRequest {
  destinationId?: string(name='DestinationId', description='The ID of the endpoint group mapping configuration.

This parameter is required.', example='dst-123abc****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp1j184jhb9i9ubwf****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeCustomRoutingEndpointGroupDestinationsResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the Global Accelerator (GA) instance.', example='ga-bp1odcab8tmno0hdq****'),
  destinationId?: string(name='DestinationId', description='The ID of the endpoint group mapping configuration.', example='dst-123abc****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
  fromPort?: int32(name='FromPort', description='The start port of the backend service port range of the endpoint group.', example='80'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  protocols?: [ string ](name='Protocols', description='The backend service protocol of the endpoint group.

*   **TCP**: TCP
*   **UDP**: UDP
*   **TCP,UDP**: TCP and UDP'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  serviceId?: string(name='ServiceId', description='The service ID to which the managed instance belongs.

>  Valid only when the ServiceManaged parameter is True.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Is it a managed instance. Valid values:

- true
- false', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='Managed policy action name, Valid values:

- Create
- Update
- Delete
- Associate
- UserUnmanaged
- CreateChild', example='Update'),
      childType?: string(name='ChildType', description='Sub resource type, Valid values:

- Listener
- IpSet
- EndpointGroup
- ForwardingRule
- Endpoint
- EndpointGroupDestination
- EndpointPolicy

>Only valid when the Action parameter is CreateChild.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Is the managed policy action managed, Valid values:

- true: The managed policy action is managed, and users do not have permission to perform the operation specified in the Action on the managed instance.

- false: The managed policy action is not managed, and users have permission to perform the operation specified in the Action on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='A list of action policies that users can execute on this managed instance.'),
  state?: string(name='State', description='The status of the endpoint group mapping configuration.

*   **init**: being initialized.
*   **active**: normal.
*   **updating**: being updated.
*   **deleting**: being deleted.', example='active'),
  toPort?: int32(name='ToPort', description='The end port of the backend service port range of the endpoint group.', example='80'),
}

model DescribeCustomRoutingEndpointGroupDestinationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomRoutingEndpointGroupDestinationsResponseBody(name='body'),
}

/**
 * @summary Queries the mapping configuration of a specified endpoint group that is associated with a custom routing listener.
 *
 * @param request DescribeCustomRoutingEndpointGroupDestinationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomRoutingEndpointGroupDestinationsResponse
 */
async function describeCustomRoutingEndpointGroupDestinationsWithOptions(request: DescribeCustomRoutingEndpointGroupDestinationsRequest, runtime: Util.RuntimeOptions): DescribeCustomRoutingEndpointGroupDestinationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationId)) {
    query['DestinationId'] = request.destinationId;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomRoutingEndpointGroupDestinations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the mapping configuration of a specified endpoint group that is associated with a custom routing listener.
 *
 * @param request DescribeCustomRoutingEndpointGroupDestinationsRequest
 * @return DescribeCustomRoutingEndpointGroupDestinationsResponse
 */
async function describeCustomRoutingEndpointGroupDestinations(request: DescribeCustomRoutingEndpointGroupDestinationsRequest): DescribeCustomRoutingEndpointGroupDestinationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomRoutingEndpointGroupDestinationsWithOptions(request, runtime);
}

model DescribeEndpointGroupRequest {
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group that you want to query.

This parameter is required.', example='epg-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The ID of the region where your Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeEndpointGroupResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
  accessLogSwitch?: string(name='AccessLogSwitch', description='Indicates the binding status between the Simple Log Service project and the endpoint group. Valid values:

*   **on:** The endpoint group is bound to the Simple Log Service project.
*   **off:** The endpoint group is not bound to the Simple Log Service project.
*   **binding:** The endpoint group is being bound to the Simple Log Service project.
*   **unbinding:** The endpoint group is being unbound from the Simple Log Service project.', example='on'),
  description?: string(name='Description', description='The description of the endpoint group.', example='group1'),
  enableAccessLog?: boolean(name='EnableAccessLog', description='Indicates whether the access log feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
  endpointConfigurations?: [ 
    {
      enableClientIPPreservation?: boolean(name='EnableClientIPPreservation', description='Indicates whether the client IP address preservation feature is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      enableProxyProtocol?: boolean(name='EnableProxyProtocol', description='Indicates whether the proxy protocol is used to preserve client IP addresses.', example='false'),
      endpoint?: string(name='Endpoint', description='The IP address, domain name, or ID of the endpoint.', example='120.XX.XX.21'),
      probePort?: int32(name='ProbePort', description='The port that is used to monitor latency.', example='80'),
      probeProtocol?: string(name='ProbeProtocol', description='The protocol that is used to monitor latency. Valid values:

*   **tcp**
*   **icmp**', example='tcp'),
      subAddress?: string(name='SubAddress', description='The private IP address of the ENI.', example='172.168.XX.XX'),
      type?: string(name='Type', description='The type of the endpoint. Valid values:

*   **Domain:** a custom domain name.
*   **Ip:** a custom IP address.
*   **PublicIp:** a public IP address provided by Alibaba Cloud.
*   **ECS:** an Elastic Compute Service (ECS) instance.
*   **SLB:**: a Server Load Balancer (SLB) instance.
*   **ALB:** an Application Load Balancer (ALB) instance.
*   **OSS:** an Object Storage Service (OSS) bucket.
*   **ENI:** an elastic network interface (ENI).
*   **NLB:** a Network Load Balancer (NLB) instance.', example='Ip'),
      weight?: int32(name='Weight', description='The weight of the endpoint.', example='20'),
    }
  ](name='EndpointConfigurations', description='The configurations of endpoints in the endpoint group.'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
  endpointGroupIpList?: [ string ](name='EndpointGroupIpList', description='The active endpoint IP addresses of the endpoint group.'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region where the endpoint group is deployed.', example='cn-hangzhou'),
  endpointGroupType?: string(name='EndpointGroupType', description='The type of endpoint group. Valid values:

*   **default**: a default endpoint group
*   **virtual**: a virtual endpoint group', example='default'),
  endpointGroupUnconfirmedIpList?: [ string ](name='EndpointGroupUnconfirmedIpList', description='The endpoint group IP addresses to be confirmed. After the GA instance is upgraded, the IP addresses that are added to the endpoint group need to be confirmed.'),
  endpointProtocolVersion?: string(name='EndpointProtocolVersion', description='The version of the protocol that is used by the backend service.

*   **HTTP1.1**
*   **HTTP2**'),
  endpointRequestProtocol?: string(name='EndpointRequestProtocol', description='The protocol that is used by the backend service.

*   **HTTP**
*   **HTTPS**', example='HTTP'),
  forwardingRuleIds?: [ string ](name='ForwardingRuleIds', description='The ID of the forwarding rule that is associated with the endpoint group.'),
  healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Indicates whether the health check feature is enabled. Valid values:

*   **true**: enabled
*   **false**: disabled', example='true'),
  healthCheckIntervalSeconds?: int32(name='HealthCheckIntervalSeconds', description='The interval between two consecutive health checks. Unit: seconds.', example='3'),
  healthCheckPath?: string(name='HealthCheckPath', description='The path to which health check probes are sent.', example='/healthcheck'),
  healthCheckPort?: int32(name='HealthCheckPort', description='The port that is used for health checks.', example='20'),
  healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol over which health check requests are sent. Valid values:

*   **tcp** or **TCP**
*   **http** or **HTTP**
*   **https** or **HTTPS**', example='tcp'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  name?: string(name='Name', description='The name of the endpoint group.', example='group1'),
  portOverrides?: [ 
    {
      endpointPort?: int32(name='EndpointPort', description='The endpoint port.', example='80'),
      listenerPort?: int32(name='ListenerPort', description='The listener port.', example='443'),
    }
  ](name='PortOverrides', description='The mappings between ports.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  serviceId?: string(name='ServiceId', description='The ID of the service that manages the GA instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the instance is managed.

*   **true**
*   **false**', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='The name of the action on the managed instance.

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
      childType?: string(name='ChildType', description='The type of the child resource.

*   **Listener:** listener.
*   **IpSet:** acceleration region.
*   **EndpointGroup:** endpoint group.
*   **ForwardingRule:** forwarding rule.
*   **Endpoint:** endpoint.
*   **EndpointGroupDestination:** protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy:** traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if the value of **Action** is **CreateChild**.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true:** The specified actions are managed. Users cannot perform the specified actions on the managed instance.****
*   **false:** The specified actions are not managed. Users can perform the specified actions on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.
>*   This parameter takes effect only if the value of **ServiceManaged** is **true**.
>*   Users can perform only specific actions on a managed instance.'),
  slsLogStoreName?: string(name='SlsLogStoreName', description='The name of the Logstore.', example='lsn-01'),
  slsProjectName?: string(name='SlsProjectName', description='The name of the Log Service project.', example='pn-01'),
  slsRegion?: string(name='SlsRegion', description='The region of the Log Service project.', example='cn-hangzhou'),
  state?: string(name='State', description='The status of the endpoint group. Valid values:

*   **init**: The endpoint group is being initialized.
*   **active**: The endpoint group is running as expected.
*   **updating**: The endpoint group is being updated.
*   **deleting**: The endpoint group is being deleted.', example='active'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key of the endpoint group.', example='test-key'),
      value?: string(name='Value', description='The tag value of the endpoint group.', example='test-value'),
    }
  ](name='Tags', description='The tag of the endpoint group.'),
  thresholdCount?: int32(name='ThresholdCount', description='The number of consecutive failed health checks that must occur before an endpoint is considered unhealthy.', example='3'),
  trafficPercentage?: int32(name='TrafficPercentage', description='The traffic ratio of the endpoint group when the specified listener is associated with multiple endpoint groups.', example='20'),
}

model DescribeEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Queries information about an endpoint group.
 *
 * @param request DescribeEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEndpointGroupResponse
 */
async function describeEndpointGroupWithOptions(request: DescribeEndpointGroupRequest, runtime: Util.RuntimeOptions): DescribeEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about an endpoint group.
 *
 * @param request DescribeEndpointGroupRequest
 * @return DescribeEndpointGroupResponse
 */
async function describeEndpointGroup(request: DescribeEndpointGroupRequest): DescribeEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEndpointGroupWithOptions(request, runtime);
}

model DescribeIpSetRequest {
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.

You can call the [ListIpSets](https://help.aliyun.com/document_detail/2253273.html) operation to query the IDs of acceleration regions of a specific GA instance.

This parameter is required.', example='ips-bp11ilwqjdkjeg9r7****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeIpSetResponseBody = {
  accelerateRegionId?: string(name='AccelerateRegionId', description='The ID of the acceleration region.', example='cn-hangzhou'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1yeeq8yfoyszmqy****'),
  bandwidth?: int32(name='Bandwidth', description='The bandwidth that is allocated to the acceleration region. Unit: Mbit/s.', example='3'),
  ipAddressList?: [ string ](name='IpAddressList', description='The list of accelerated IP addresses in the acceleration region.'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.', example='ips-bp11ilwqjdkjeg9r7****'),
  ipVersion?: string(name='IpVersion', description='The IP version. Valid values:

*   **IPv4**
*   **IPv6**
*   **DUAL_STACK**', example='IPv4'),
  ispType?: string(name='IspType', description='The line type of the elastic IP address (EIP) in the acceleration region. Valid values:

*   **BGP**: BGP (Multi-ISP) lines. This is the default value.
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines.', example='BGP'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6D2BFF54-6AF2-4679-88C4-2F2E187F16CB'),
  serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter is returned only if the value of **ServiceManaged** is **true**.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
      childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if **Action** is set to **CreateChild**.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true**: The specified actions are managed, and users cannot perform the actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the actions on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

> *   This parameter is returned only if the value of **ServiceManaged** is **true**.
>*   Users can perform only specific actions on a managed instance.'),
  state?: string(name='State', description='The status of the acceleration region. Valid values:

*   **init**: The acceleration region is being initialized.
*   **active**: The acceleration region is in the running state.
*   **updating**: The acceleration region is being configured.
*   **deleting**: The GA instance is being deleted.', example='active'),
}

model DescribeIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIpSetResponseBody(name='body'),
}

/**
 * @summary Queries information about an acceleration region.
 *
 * @param request DescribeIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIpSetResponse
 */
async function describeIpSetWithOptions(request: DescribeIpSetRequest, runtime: Util.RuntimeOptions): DescribeIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about an acceleration region.
 *
 * @param request DescribeIpSetRequest
 * @return DescribeIpSetResponse
 */
async function describeIpSet(request: DescribeIpSetRequest): DescribeIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIpSetWithOptions(request, runtime);
}

model DescribeListenerRequest {
  listenerId?: string(name='ListenerId', description='The ID of the listener that you want to query.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeListenerResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
  aclType?: string(name='AclType', description='The type of the ACL. Valid values:

*   **white**: a whitelist. Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. Whitelists are suitable for scenarios in which you want to allow only specific IP addresses to access an application. If a whitelist is improperly configured, risks may arise. After a whitelist is configured for a listener, only requests from the IP addresses that are added to the whitelist are distributed by the listener. If the whitelist is enabled but no IP addresses are added to the ACL, the listener does not forward requests.
*   **black**: a blacklist. All requests from the IP addresses or CIDR blocks in the ACL are blocked. Blacklists are suitable for scenarios in which you want to deny access from specific IP addresses to an application. If the blacklist is enabled but no IP addresses are added to the ACL, the listener forwards all requests.

This parameter is returned only if the value of **Status** is **on**.', example='white'),
  backendPorts?: [ 
    {
      fromPort?: string(name='FromPort', description='The first port in the range of ports that are used by the backend server to receive requests.

This parameter is returned only if an HTTPS listener is configured and the listener port is the same as the service port of the backend server.', example='80'),
      toPort?: string(name='ToPort', description='The last port in the range of ports that are used by the backend server to receive requests.', example='80'),
    }
  ](name='BackendPorts', description='The information about the backend ports.'),
  certificates?: [ 
    {
      id?: string(name='Id', description='The ID of the SSL certificate.', example='449****-cn-hangzhou'),
      type?: string(name='Type', description='The type of the SSL certificate.

Only **Server** may be returned, which indicates a server certificate.', example='Server'),
    }
  ](name='Certificates', description='The SSL certificates.'),
  clientAffinity?: string(name='ClientAffinity', description='Indicates whether client affinity is enabled for the listener.

*   If **NONE** is returned, client affinity is disabled. Requests from the same client may be forwarded to different endpoints.
*   If **SOURCE_IP** is returned, client affinity is enabled. When a client accesses stateful applications, requests from the same client are forwarded to the same endpoint regardless of the source port or protocol.', example='SOURCE_IP'),
  createTime?: string(name='CreateTime', description='The time when the listener was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Unit: milliseconds.', example='1577786252000'),
  description?: string(name='Description', description='The description of the listener.', example='Listener'),
  httpVersion?: string(name='HttpVersion', description='The maximum version of the HTTP protocol. Valid values:

*   **http3**
*   **http2**
*   **http1.1**

>  This parameter is returned only for HTTPS listeners.', example='http2'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of idle connections. Unit: seconds.', example='900'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  name?: string(name='Name', description='The name of the listener.', example='Listener'),
  portRanges?: [ 
    {
      fromPort?: int32(name='FromPort', description='The first port in the range of listener ports that are used to receive and forward requests to endpoints.', example='20'),
      toPort?: int32(name='ToPort', description='The last port in the range of listener ports that are used to receive and forward requests to endpoints.', example='20'),
    }
  ](name='PortRanges', description='The information about the listener ports.'),
  protocol?: string(name='Protocol', description='The network transmission protocol that is used by the listener. Valid values:

*   **tcp**: TCP.
*   **udp**: UDP.
*   **http**: HTTP.
*   **https**: HTTPS.', example='tcp'),
  proxyProtocol?: boolean(name='ProxyProtocol', description='Indicates whether the client IP address preservation feature is enabled. Valid values:

*   **true** You can view the source IP addresses of clients over the backend service.
*   **false**', example='false'),
  relatedAcls?: [ 
    {
      aclId?: string(name='AclId', description='The ID of the ACL that is associated with the listener.', example='123'),
      status?: string(name='Status', description='Indicates whether the access control feature is enabled. Valid values:

*   **on**: enabled.
*   **off**: disabled.', example='off'),
    }
  ](name='RelatedAcls', description='The information about the access control list (ACL) that is associated with the listener.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period of HTTP or HTTPS requests. Unit: seconds.

>  This parameter is returned only for HTTP and HTTPS listeners. If no responses are received from the backend server within the specified timeout period, GA returns the HTTP 504 error code to the client.', example='60'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.

*   **tls_cipher_policy_1_0**

    *   Supported Transport Layer Security (TLS) versions: TLS 1.0, TLS 1.1, and TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_1**

    *   Supported TLS versions: TLS 1.1 and TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_2**

    *   Supported TLS version: TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_2_strict**

    *   Supported TLS version: TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.

*   **tls_cipher_policy_1_2_strict_with_1_3**

    *   Supported TLS versions: TLS 1.2 and TLS 1.3.
    *   Supported cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-ECDSA-AES128-SHA, ECDHE-ECDSA-AES256-SHA, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.

>  This parameter is returned only for HTTPS listeners.', example='tls_cipher_policy_1_0'),
  serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter is returned only if the value of **ServiceManaged** is **true**.', example='ALB'),
  serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
  serviceManagedInfos?: [ 
    {
      action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
      childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: a listener.
*   **IpSet**: an acceleration region.
*   **EndpointGroup**: an endpoint group.
*   **ForwardingRule**: a forwarding rule.
*   **Endpoint**: an endpoint.
*   **EndpointGroupDestination**: a protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: a traffic policy of an endpoint associated with a custom routing listener.

>  This parameter is returned only if the value of **Action** is **CreateChild**.', example='Listener'),
      isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
    }
  ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.
>*   This parameter is returned only if the value of **ServiceManaged** is **true**.
>*   Users can perform only specific actions on a managed instance.'),
  state?: string(name='State', description='The status of the listener. Valid values:

*   **configuring**: The listener is being configured.
*   **init**: The listener is being initialized.
*   **updating**: The listener is being updated.
*   **deleting:** The listener is being deleted.', example='active'),
  type?: string(name='Type', description='The routing type of the listener. Valid values:

*   **Standard**: intelligent routing.
*   **CustomRouting**: custom routing.', example='Standard'),
  XForwardedForConfig?: {
    XForwardedForGaApEnabled?: boolean(name='XForwardedForGaApEnabled', description='Indicates whether the `GA-AP` header is used to retrieve information about acceleration regions. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
    XForwardedForGaIdEnabled?: boolean(name='XForwardedForGaIdEnabled', description='Indicates whether the `GA-ID` header is used to retrieve the ID of the GA instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
    XForwardedForPortEnabled?: boolean(name='XForwardedForPortEnabled', description='Indicates whether the `GA-X-Forward-Port` header is used to retrieve the listener ports of the GA instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
    XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Indicates whether the `GA-X-Forward-Proto` header is used to retrieve the listener protocol of the GA instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
    XRealIpEnabled?: boolean(name='XRealIpEnabled', description='Indicates whether the `X-Real-IP` header is used to retrieve client IP addresses. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
  }(name='XForwardedForConfig', description='The configurations of the `XForward` headers.'),
}

model DescribeListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeListenerResponseBody(name='body'),
}

/**
 * @summary Queries configuration information about a listener of a Global Accelerator (GA) instance.
 *
 * @description This operation is used to query configuration information about a listener of a GA instance. The information includes the routing type of the listener, the status of the listener, the timestamp that indicates when the listener was created, and the listener ports.
 *
 * @param request DescribeListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeListenerResponse
 */
async function describeListenerWithOptions(request: DescribeListenerRequest, runtime: Util.RuntimeOptions): DescribeListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries configuration information about a listener of a Global Accelerator (GA) instance.
 *
 * @description This operation is used to query configuration information about a listener of a GA instance. The information includes the routing type of the listener, the status of the listener, the timestamp that indicates when the listener was created, and the listener ports.
 *
 * @param request DescribeListenerRequest
 * @return DescribeListenerResponse
 */
async function describeListener(request: DescribeListenerRequest): DescribeListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeListenerWithOptions(request, runtime);
}

model DescribeLogStoreOfEndpointGroupRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-xxxxxxxxxxxxx'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-xxxxxxxxxxxxxxx'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-xxxxxxxxxxxxxxx'),
  regionId?: string(name='RegionId', description='The region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeLogStoreOfEndpointGroupResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-xxxxxxxxxxxxx'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-xxxxxxxxxxxxxxx'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-xxxxxxxxxxxxxxx'),
  requestId?: string(name='RequestId', description='The response parameters.', example='1777E713-8456-55F1-9A69-9AD9EAE2B3B6'),
  slsLogStoreName?: string(name='SlsLogStoreName', description='The name of the Logstore.', example='ga_log'),
  slsProjectName?: string(name='SlsProjectName', description='The name of the Simple Log Service project.', example='ga_project_name'),
  slsRegionId?: string(name='SlsRegionId', description='The region ID of the Simple Log Service project.', example='cn-hangzhou'),
  status?: string(name='Status', description='Indicates whether the endpoint group is bound to the Simple Log Service project.

*   **on:** The endpoint group is bound to the Simple Log Service project.
*   **off:** The endpoint group is not bound to the Simple Log Service project.', example='on - binding
off - unbinding'),
}

model DescribeLogStoreOfEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogStoreOfEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Queries the Simple Log Service project and Logstore associated with an endpoint group.
 *
 * @param request DescribeLogStoreOfEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogStoreOfEndpointGroupResponse
 */
async function describeLogStoreOfEndpointGroupWithOptions(request: DescribeLogStoreOfEndpointGroupRequest, runtime: Util.RuntimeOptions): DescribeLogStoreOfEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogStoreOfEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the Simple Log Service project and Logstore associated with an endpoint group.
 *
 * @param request DescribeLogStoreOfEndpointGroupRequest
 * @return DescribeLogStoreOfEndpointGroupResponse
 */
async function describeLogStoreOfEndpointGroup(request: DescribeLogStoreOfEndpointGroupRequest): DescribeLogStoreOfEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogStoreOfEndpointGroupWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The region name.', example='China (Hangzhou)'),
      regionId?: string(name='RegionId', description='The region ID. Only **cn-hangzhou** is returned.', example='cn-hangzhou'),
    }
  ](name='Regions', description='The available regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='611CB80C-B6A9-43DB-9E38-0B0AC3D9B58F'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries the regions where Global Accelerator (GA) instances are deployed.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the regions where Global Accelerator (GA) instances are deployed.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DetachDdosFromAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model DetachDdosFromAcceleratorResponseBody = {
  ddosId?: string(name='DdosId', description='The ID of the Anti-DDoS Pro/Premium instance that was disassociated from the GA instance.', example='ddoscoo-cn-zz11vq7j****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0ED8D006-F706-4D23-88ED-E11ED28DCAC0'),
}

model DetachDdosFromAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachDdosFromAcceleratorResponseBody(name='body'),
}

/**
 * @summary Disassociates a Global Accelerator (GA) instance from an Anti-DDoS Pro or Anti-DDoS Premium instance.
 *
 * @description *   The **DetachDdosFromAccelerator** operation is asynchronous. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) or [ListAccelerators](https://help.aliyun.com/document_detail/153236.html) operation to query the status of the GA instance.
 *     *   If the GA instance is in the **configuring** state, the Anti-DDoS Pro/Premium instance is being disassociated from the GA instance. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the Anti-DDoS Pro/Premium instance is disassociated from the GA instance.
 * *   **DetachDdosFromAccelerator** cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request DetachDdosFromAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachDdosFromAcceleratorResponse
 */
async function detachDdosFromAcceleratorWithOptions(request: DetachDdosFromAcceleratorRequest, runtime: Util.RuntimeOptions): DetachDdosFromAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachDdosFromAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a Global Accelerator (GA) instance from an Anti-DDoS Pro or Anti-DDoS Premium instance.
 *
 * @description *   The **DetachDdosFromAccelerator** operation is asynchronous. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) or [ListAccelerators](https://help.aliyun.com/document_detail/153236.html) operation to query the status of the GA instance.
 *     *   If the GA instance is in the **configuring** state, the Anti-DDoS Pro/Premium instance is being disassociated from the GA instance. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the Anti-DDoS Pro/Premium instance is disassociated from the GA instance.
 * *   **DetachDdosFromAccelerator** cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request DetachDdosFromAcceleratorRequest
 * @return DetachDdosFromAcceleratorResponse
 */
async function detachDdosFromAccelerator(request: DetachDdosFromAcceleratorRequest): DetachDdosFromAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachDdosFromAcceleratorWithOptions(request, runtime);
}

model DetachLogStoreFromEndpointGroupRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The client token can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** for each API request may be different.', example='02fb3da4****'),
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of endpoint groups.

This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DetachLogStoreFromEndpointGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model DetachLogStoreFromEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachLogStoreFromEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Disassociates a Log Service Logstore from an endpoint group.
 *
 * @description ## Description
 * *   **DetachLogStoreFromEndpointGroup** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, the Log Service Logstore is being disassociated from the endpoint group. In this case, you can perform only query operations.
 *     <!---->
 *     *   If the endpoint group is in the **active** state, the Log Service Logstore is disassociated from the endpoint group.
 * *   The **DetachLogStoreFromEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DetachLogStoreFromEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachLogStoreFromEndpointGroupResponse
 */
async function detachLogStoreFromEndpointGroupWithOptions(request: DetachLogStoreFromEndpointGroupRequest, runtime: Util.RuntimeOptions): DetachLogStoreFromEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupIds)) {
    query['EndpointGroupIds'] = request.endpointGroupIds;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachLogStoreFromEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a Log Service Logstore from an endpoint group.
 *
 * @description ## Description
 * *   **DetachLogStoreFromEndpointGroup** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, the Log Service Logstore is being disassociated from the endpoint group. In this case, you can perform only query operations.
 *     <!---->
 *     *   If the endpoint group is in the **active** state, the Log Service Logstore is disassociated from the endpoint group.
 * *   The **DetachLogStoreFromEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DetachLogStoreFromEndpointGroupRequest
 * @return DetachLogStoreFromEndpointGroupResponse
 */
async function detachLogStoreFromEndpointGroup(request: DetachLogStoreFromEndpointGroupRequest): DetachLogStoreFromEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachLogStoreFromEndpointGroupWithOptions(request, runtime);
}

model DetectApplicationMonitorRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task for which you want to enable the diagnostic feature.

This parameter is required.', example='2c8dbdf9-a3ab-46a1-85a4-f094965e****'),
}

model DetectApplicationMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DetectApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetectApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Enables the diagnostic feature for an origin probing task.
 *
 * @param request DetectApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetectApplicationMonitorResponse
 */
async function detectApplicationMonitorWithOptions(request: DetectApplicationMonitorRequest, runtime: Util.RuntimeOptions): DetectApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetectApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables the diagnostic feature for an origin probing task.
 *
 * @param request DetectApplicationMonitorRequest
 * @return DetectApplicationMonitorResponse
 */
async function detectApplicationMonitor(request: DetectApplicationMonitorRequest): DetectApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return detectApplicationMonitorWithOptions(request, runtime);
}

model DisableApplicationMonitorRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task that you want to disable.

This parameter is required.', example='sm-bp1fpdjfju9k8yr1y****'),
}

model DisableApplicationMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DisableApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Disables an origin probing task.
 *
 * @param request DisableApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableApplicationMonitorResponse
 */
async function disableApplicationMonitorWithOptions(request: DisableApplicationMonitorRequest, runtime: Util.RuntimeOptions): DisableApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables an origin probing task.
 *
 * @param request DisableApplicationMonitorRequest
 * @return DisableApplicationMonitorResponse
 */
async function disableApplicationMonitor(request: DisableApplicationMonitorRequest): DisableApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableApplicationMonitorWithOptions(request, runtime);
}

model DissociateAclsFromListenerRequest {
  aclIds?: [ string ](name='AclIds', description='The ID of the ACL. You can disassociate up to two ACLs from a listener.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to only precheck the request. Default value: false. Valid values:

*   **true**: prechecks the request without performing the operation. The system prechecks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false**: sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DissociateAclsFromListenerResponseBody = {
  aclIds?: [ string ](name='AclIds', description='The IDs of the ACL.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DissociateAclsFromListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateAclsFromListenerResponseBody(name='body'),
}

/**
 * @summary Disassociates access control lists (ACLs) from a listener.
 *
 * @description ## Description
 * *   **DissociateAclsFromListener** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the state of a listener:
 *     *   If the listener is in the **updating** state, ACLs are being disassociated from the listener. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, ACLs are disassociated from the listener.
 * *   The **DissociateAclsFromListener** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DissociateAclsFromListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateAclsFromListenerResponse
 */
async function dissociateAclsFromListenerWithOptions(request: DissociateAclsFromListenerRequest, runtime: Util.RuntimeOptions): DissociateAclsFromListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DissociateAclsFromListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates access control lists (ACLs) from a listener.
 *
 * @description ## Description
 * *   **DissociateAclsFromListener** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the state of a listener:
 *     *   If the listener is in the **updating** state, ACLs are being disassociated from the listener. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, ACLs are disassociated from the listener.
 * *   The **DissociateAclsFromListener** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request DissociateAclsFromListenerRequest
 * @return DissociateAclsFromListenerResponse
 */
async function dissociateAclsFromListener(request: DissociateAclsFromListenerRequest): DissociateAclsFromListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return dissociateAclsFromListenerWithOptions(request, runtime);
}

model DissociateAdditionalCertificatesFromListenerRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. ClientToken can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** may be different for each API request.', example='123e4567-e89b-12d3-a456-426655440000'),
  domains?: [ string ](name='Domains', description='The domain name associated with the additional certificate.

You can specify up to 10 domain names in each request.

This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model DissociateAdditionalCertificatesFromListenerResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model DissociateAdditionalCertificatesFromListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateAdditionalCertificatesFromListenerResponseBody(name='body'),
}

/**
 * @summary Disassociates an additional certificate from an HTTPS listener.
 *
 * @description ## Description
 * *   **DissociateAdditionalCertificatesFromListener** is an asynchronous operation. After you send a request, the system returns a request ID, but this operation is still being performed in the system background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the state of an HTTPS listener.
 *     *   If the listener is in the **updating** state, it indicates that the additional certificate is being dissociated from the listener. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that the additional certificate is dissociated from the listener.
 * *   The **DissociateAdditionalCertificatesFromListener** operation cannot be repeatedly called for the same Global Accelerator (GA) instance with a specific period of time.
 *
 * @param request DissociateAdditionalCertificatesFromListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateAdditionalCertificatesFromListenerResponse
 */
async function dissociateAdditionalCertificatesFromListenerWithOptions(request: DissociateAdditionalCertificatesFromListenerRequest, runtime: Util.RuntimeOptions): DissociateAdditionalCertificatesFromListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.domains)) {
    query['Domains'] = request.domains;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DissociateAdditionalCertificatesFromListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates an additional certificate from an HTTPS listener.
 *
 * @description ## Description
 * *   **DissociateAdditionalCertificatesFromListener** is an asynchronous operation. After you send a request, the system returns a request ID, but this operation is still being performed in the system background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the state of an HTTPS listener.
 *     *   If the listener is in the **updating** state, it indicates that the additional certificate is being dissociated from the listener. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that the additional certificate is dissociated from the listener.
 * *   The **DissociateAdditionalCertificatesFromListener** operation cannot be repeatedly called for the same Global Accelerator (GA) instance with a specific period of time.
 *
 * @param request DissociateAdditionalCertificatesFromListenerRequest
 * @return DissociateAdditionalCertificatesFromListenerResponse
 */
async function dissociateAdditionalCertificatesFromListener(request: DissociateAdditionalCertificatesFromListenerRequest): DissociateAdditionalCertificatesFromListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return dissociateAdditionalCertificatesFromListenerWithOptions(request, runtime);
}

model EnableApplicationMonitorRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task that you want to enable.

This parameter is required.', example='sm-bp1fpdjfju9k8yr1y****'),
}

model EnableApplicationMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model EnableApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Enables an origin probing task.
 *
 * @param request EnableApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableApplicationMonitorResponse
 */
async function enableApplicationMonitorWithOptions(request: EnableApplicationMonitorRequest, runtime: Util.RuntimeOptions): EnableApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables an origin probing task.
 *
 * @param request EnableApplicationMonitorRequest
 * @return EnableApplicationMonitorResponse
 */
async function enableApplicationMonitor(request: EnableApplicationMonitorRequest): EnableApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableApplicationMonitorWithOptions(request, runtime);
}

model GetAclRequest {
  aclId?: string(name='AclId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  regionId?: string(name='RegionId', description='The operation that you want to perform. Set the value to **GetAcl**.

This parameter is required.', example='cn-hangzhou'),
}

model GetAclResponseBody = {
  aclEntries?: [ 
    {
      entry?: string(name='Entry', description='An IP address entry (192.168.XX.XX) or a CIDR block entry (10.0.XX.XX/24).', example='10.0.XX.XX/24'),
      entryDescription?: string(name='EntryDescription', description='The description of the ACL entry.', example='test-entry'),
    }
  ](name='AclEntries', description='The entries of the ACL.'),
  aclId?: string(name='AclId', description='The ID of the request.', example='nacl-hp34s2h0xx1ht4nwo****'),
  aclName?: string(name='AclName', description='The ID of the GA instance.', example='test-acl'),
  aclStatus?: string(name='AclStatus', description='The IP version of the network ACL. Valid values:

*   **IPv4**
*   **IPv6**', example='active'),
  addressIPVersion?: string(name='AddressIPVersion', description='The ID of the network ACL.', example='IPv4'),
  relatedListeners?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      aclType?: string(name='AclType', description='The type of the ACL. Valid values:

*   **white**: Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. Whitelists are suitable for scenarios in which you want to allow access from specific IP addresses to an application. If a whitelist is improperly configured, risks may arise. After a whitelist is configured for a listener, only requests from the IP addresses that are added to the whitelist are distributed by the listener. If a whitelist is enabled but no IP address is added to the whitelist, the listener forwards all requests.
*   **black**: All requests from the IP addresses or CIDR blocks in the ACL are rejected. Blacklists are suitable for scenarios in which you want to deny access from specific IP addresses to an application. If a blacklist is enabled but no IP address is added to the blacklist, the listener forwards all requests.', example='White'),
      listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
    }
  ](name='RelatedListeners', description='The listeners that are associated with the ACL.'),
  requestId?: string(name='RequestId', description='The ID of the network ACL.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  resourceGroupId?: string(name='ResourceGroupId', description='The name of the network ACL.', example='rg-acfmx7itmygzsza'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of tag N that is add to the ACL.', example='tag-key'),
      value?: string(name='Value', description='The value of tag N that is add to the ACL.', example='tag-value'),
    }
  ](name='Tags', description='The tag of the ACL.'),
}

model GetAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAclResponseBody(name='body'),
}

/**
 * @summary Queries an access control list (ACL).
 *
 * @param request GetAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAclResponse
 */
async function getAclWithOptions(request: GetAclRequest, runtime: Util.RuntimeOptions): GetAclResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAcl',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries an access control list (ACL).
 *
 * @param request GetAclRequest
 * @return GetAclResponse
 */
async function getAcl(request: GetAclRequest): GetAclResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAclWithOptions(request, runtime);
}

model GetBasicAccelerateIpRequest {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the basic GA instance that you want to query.

You can call the [ListBasicAccelerateIps](https://help.aliyun.com/document_detail/2253393.html) operation to query the ID of the accelerated IP address.

This parameter is required.', example='gaip-bp1****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicAccelerateIpResponseBody = {
  accelerateIpAddress?: string(name='AccelerateIpAddress', description='The accelerated IP address of the basic GA instance.', example='116.132.XX.XX'),
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance to which the queried accelerated IP address belongs.', example='ga-bp17frjjh0udz4qz****'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region of the basic GA instance.', example='ips-bp11r5jb8ogp122xl****'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The status of the accelerated IP address. Valid values:

*   **active**: The accelerated IP address is available.
*   **binding**: The accelerated IP address is being associated.
*   **bound**: The accelerated IP address is associated.
*   **unbinding**: The accelerated IP address is being disassociated.
*   **deleting**: The GA instance is being deleted.

>  If the accelerated IP address is being created, this parameter is not returned.', example='active'),
}

model GetBasicAccelerateIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicAccelerateIpResponseBody(name='body'),
}

/**
 * @summary Queries the status of an accelerated IP address of a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicAccelerateIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicAccelerateIpResponse
 */
async function getBasicAccelerateIpWithOptions(request: GetBasicAccelerateIpRequest, runtime: Util.RuntimeOptions): GetBasicAccelerateIpResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicAccelerateIp',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of an accelerated IP address of a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicAccelerateIpRequest
 * @return GetBasicAccelerateIpResponse
 */
async function getBasicAccelerateIp(request: GetBasicAccelerateIpRequest): GetBasicAccelerateIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicAccelerateIpWithOptions(request, runtime);
}

model GetBasicAccelerateIpEndpointRelationRequest {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.

>  You must specify **EndpointId** or **AccelerateIpId**.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.

>  You must specify **EndpointId** or **AccelerateIpId**.', example='ep-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicAccelerateIpEndpointRelationResponseBody = {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp11v53zfftax68b0daws'),
  endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
  endpointName?: string(name='EndpointName', description='The name of the endpoint.', example='ep01'),
  endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, **EndpointSubAddress** returns the primary or secondary private IP address of the primary ENI.
*   If the endpoint type is **ENI**, **EndpointSubAddress** returns the primary or secondary private IP address of the secondary ENI.
*   If the endpoint type is **NLB**, **EndpointSubAddress** returns the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
  endpointSubAddressType?: string(name='EndpointSubAddressType', description='The type of the secondary address of the endpoint.

*   **primary**: a primary private IP address.
*   **secondary**: a secondary private IP address.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**. If the endpoint type is set to **NLB**, **primary** is returned.', example='primary'),
  endpointType?: string(name='EndpointType', description='The type of endpoint. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.
*   **NLB**: Network Load Balancer (NLB) instance.', example='ENI'),
  endpointZoneId?: string(name='EndpointZoneId', description='The ID of the zone where the endpoint is created.

This parameter is returned only when the endpoint type is **NLB**.', example='cn-hangzhou-g'),
  ipAddress?: string(name='IpAddress', description='The accelerated IP address of the basic GA instance.', example='116.132.XX.XX'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The association status between the accelerated IP address and endpoint.

A value of **active** indicates that the accelerated IP address is associated with the endpoint.', example='active'),
}

model GetBasicAccelerateIpEndpointRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicAccelerateIpEndpointRelationResponseBody(name='body'),
}

/**
 * @summary Queries whether the accelerated IP address of a basic Global Accelerator (GA) instance is associated with an endpoint.
 *
 * @param request GetBasicAccelerateIpEndpointRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicAccelerateIpEndpointRelationResponse
 */
async function getBasicAccelerateIpEndpointRelationWithOptions(request: GetBasicAccelerateIpEndpointRelationRequest, runtime: Util.RuntimeOptions): GetBasicAccelerateIpEndpointRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicAccelerateIpEndpointRelation',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether the accelerated IP address of a basic Global Accelerator (GA) instance is associated with an endpoint.
 *
 * @param request GetBasicAccelerateIpEndpointRelationRequest
 * @return GetBasicAccelerateIpEndpointRelationResponse
 */
async function getBasicAccelerateIpEndpointRelation(request: GetBasicAccelerateIpEndpointRelationRequest): GetBasicAccelerateIpEndpointRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicAccelerateIpEndpointRelationWithOptions(request, runtime);
}

model GetBasicAccelerateIpIdleCountRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ipSetId?: string(name='IpSetId', description='The ID of the basic GA instance that you want to query.

You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/2253380.html) operation to query the region ID.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicAccelerateIpIdleCountResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: long(name='TotalCount', description='The number of entries returned, which indicates the number of idle accelerated IP addresses.', example='1'),
}

model GetBasicAccelerateIpIdleCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicAccelerateIpIdleCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of idle accelerated IP addresses of a Global Accelerator (GA) instance.
 *
 * @param request GetBasicAccelerateIpIdleCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicAccelerateIpIdleCountResponse
 */
async function getBasicAccelerateIpIdleCountWithOptions(request: GetBasicAccelerateIpIdleCountRequest, runtime: Util.RuntimeOptions): GetBasicAccelerateIpIdleCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicAccelerateIpIdleCount',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of idle accelerated IP addresses of a Global Accelerator (GA) instance.
 *
 * @param request GetBasicAccelerateIpIdleCountRequest
 * @return GetBasicAccelerateIpIdleCountResponse
 */
async function getBasicAccelerateIpIdleCount(request: GetBasicAccelerateIpIdleCountRequest): GetBasicAccelerateIpIdleCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicAccelerateIpIdleCountWithOptions(request, runtime);
}

model GetBasicAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance that you want to query.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  regionId?: string(name='RegionId', description='The ID of the region to which the basic GA instance belongs. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicAcceleratorResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  bandwidthBillingType?: string(name='BandwidthBillingType', description='The bandwidth metering method.

*   **BandwidthPackage**: billed based on bandwidth plans.
*   **CDT**: billed by Cloud Data Transfer (CDT) and based on data transfer.
*   **CDT95**: billed by CDT and based on the 95th percentile bandwidth. This bandwidth metering method is available only to users that are included in the whitelist.', example='CDT'),
  basicBandwidthPackage?: {
    bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the basic bandwidth plan. Unit: Mbit/s.', example='2'),
    bandwidthType?: string(name='BandwidthType', description='The type of the bandwidth that is provided by the basic bandwidth plan.

*   **Basic**: basic
*   **Enhanced**: enhanced
*   **Advanced**: premium', example='Basic'),
    instanceId?: string(name='InstanceId', description='The ID of the basic bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
  }(name='BasicBandwidthPackage', description='The details about the basic bandwidth plan that is associated with the basic GA instance.'),
  basicEndpointGroupId?: string(name='BasicEndpointGroupId', description='The ID of the endpoint group.', example='epg-bp1dmlohjjz4kqaun****'),
  basicIpSetId?: string(name='BasicIpSetId', description='The ID of the acceleration region.', example='ips-bp11ilwqjdkjeg9r7****'),
  cenId?: string(name='CenId', description='The ID of the Cloud Enterprise Network (CEN) instance to which the basic GA instance is attached.', example='cen-hjkduu767hc****'),
  createTime?: long(name='CreateTime', description='The timestamp that indicates when the basic GA instance is created.', example='1637734547'),
  crossBorderStatus?: boolean(name='CrossBorderStatus', description='Indicates whether cross-border acceleration is enabled for the basic GA instance. Valid values:

*   **true**
*   **false**', example='false'),
  crossDomainBandwidthPackage?: {
    bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the cross-border acceleration bandwidth plan. Unit: Mbit/s.', example='2'),
    instanceId?: string(name='InstanceId', description='The ID of the cross-border acceleration bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
  }(name='CrossDomainBandwidthPackage', description='The details about the cross-border acceleration bandwidth plan that is associated with the GA instance.

This array is returned only for GA instances that are created on the international site (alibabacloud.com).'),
  crossPrivateState?: string(name='CrossPrivateState', description='Indicates whether cross-border acceleration is enabled.

*   **true**: yes
*   **false**: no', example='false'),
  description?: string(name='Description', description='The description of the basic GA instance.', example='BasicAccelerator'),
  expiredTime?: long(name='ExpiredTime', description='The timestamp that indicates when the basic GA instance expires.

The time follows the UNIX time format. It is the number of seconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1640326547'),
  instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the basic GA instance. Only **PREPAY** is returned, which indicates the subscription billing method.', example='PREPAY'),
  name?: string(name='Name', description='The name of the basic GA instance.', example='BasicAccelerator'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the basic GA instance belongs.', example='rg-aekzrnd67gq****'),
  state?: string(name='State', description='The status of the basic GA instance.

*   **init**: The GA instance is being initialized.
*   **active**: The GA instance is available.
*   **configuring**: The GA instance is being configured.
*   **binding**: The GA instance is being associated.
*   **unbinding**: The GA instance is being disassociated.
*   **deleting**: The GA instance is being deleted.
*   **finacialLocked**: The GA instance is locked due to overdue payments.', example='active'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='tag-key'),
      value?: string(name='Value', description='The tag value.', example='tag-value'),
    }
  ](name='Tags', description='The tags of the basic GA instance.'),
}

model GetBasicAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicAcceleratorResponseBody(name='body'),
}

/**
 * @summary Queries the information about a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicAcceleratorResponse
 */
async function getBasicAcceleratorWithOptions(request: GetBasicAcceleratorRequest, runtime: Util.RuntimeOptions): GetBasicAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicAcceleratorRequest
 * @return GetBasicAcceleratorResponse
 */
async function getBasicAccelerator(request: GetBasicAcceleratorRequest): GetBasicAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicAcceleratorWithOptions(request, runtime);
}

model GetBasicEndpointRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint that you want to query.

This parameter is required.', example='ep-bp14sz7ftcwwjgrdm****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicEndpointResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  endPointId?: string(name='EndPointId', description='The ID of the endpoint that is associated with the basic GA instance.', example='ep-bp14sz7ftcwwjgrdm****'),
  endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint belongs.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, **EndpointSubAddress** returns the primary or secondary private IP address of the primary ENI.
*   If the endpoint type is **ENI**, **EndpointSubAddress** returns the primary or secondary private IP address of the secondary ENI.
*   If the endpoint type is **NLB**, **EndpointSubAddress** returns the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
  endpointSubAddressType?: string(name='EndpointSubAddressType', description='The type of the secondary address of the endpoint.

*   **primary**: a primary private IP address.
*   **secondary**: a secondary private IP address.

This parameter is returned if the type of the endpoint is set to **ECS**, **ENI**, or **NLB**. If the endpoint type is set to **NLB**, **primary** is returned.', example='primary'),
  endpointType?: string(name='EndpointType', description='The type of endpoint. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.
*   **NLB**: Network Load Balancer (NLB) instance.', example='ENI'),
  endpointZoneId?: string(name='EndpointZoneId', description='The ID of the zone where the endpoint is deployed.

This parameter is returned only when the endpoint type is set to **NLB**.', example='cn-hangzhou-g'),
  name?: string(name='Name', description='The name of the endpoint.', example='ep01'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The status of the endpoint. Valid values:

*   **init**: The endpoint is being initialized.
*   **active**: The endpoint is available.
*   **updating**: The endpoint is being configured.
*   **binding**: The endpoint is being associated.
*   **unbinding**: The endpoint is being disassociated.
*   **deleting**: The endpoint is being deleted.
*   **bound**: The endpoint is associated.', example='active'),
}

model GetBasicEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicEndpointResponseBody(name='body'),
}

/**
 * @summary Queries detailed information about an endpoint that is associated with a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicEndpointResponse
 */
async function getBasicEndpointWithOptions(request: GetBasicEndpointRequest, runtime: Util.RuntimeOptions): GetBasicEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicEndpoint',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries detailed information about an endpoint that is associated with a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicEndpointRequest
 * @return GetBasicEndpointResponse
 */
async function getBasicEndpoint(request: GetBasicEndpointRequest): GetBasicEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicEndpointWithOptions(request, runtime);
}

model GetBasicEndpointGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicEndpointGroupResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  description?: string(name='Description', description='The description of the endpoint group.', example='BasicEndpointGroup'),
  endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region where the endpoint group resides.', example='cn-shanghai'),
  endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, **EndpointSubAddress** returns the primary or secondary private IP address of the primary ENI.
*   If the endpoint type is **ENI**, **EndpointSubAddress** returns the primary or secondary private IP address of the secondary ENI.
*   If the endpoint type is **NLB**, **EndpointSubAddress** returns the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
  endpointType?: string(name='EndpointType', description='The type of endpoint. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.
*   **NLB**: Network Load Balancer (NLB) instance', example='ENI'),
  name?: string(name='Name', description='The name of the endpoint group.', example='group1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The status of the endpoint group. Valid values:

*   **init**: being initialized.
*   **active**: running as expected.
*   **updating**: being updated.
*   **deleting**: being deleted.', example='active'),
}

model GetBasicEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Queries the information about the endpoint group of a basic GA instance.
 *
 * @param request GetBasicEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicEndpointGroupResponse
 */
async function getBasicEndpointGroupWithOptions(request: GetBasicEndpointGroupRequest, runtime: Util.RuntimeOptions): GetBasicEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the endpoint group of a basic GA instance.
 *
 * @param request GetBasicEndpointGroupRequest
 * @return GetBasicEndpointGroupResponse
 */
async function getBasicEndpointGroup(request: GetBasicEndpointGroupRequest): GetBasicEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicEndpointGroupWithOptions(request, runtime);
}

model GetBasicIpSetRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.

You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/2253380.html) operation to query the region ID.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetBasicIpSetResponseBody = {
  accelerateRegionId?: string(name='AccelerateRegionId', description='The ID of the region where the basic GA instance is deployed.', example='cn-hangzhou'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  bandwidth?: long(name='Bandwidth', description='The bandwidth of the acceleration region of the basic GA instance. Unit: Mbit/s.', example='2'),
  ipAddress?: string(name='IpAddress', description='The accelerated IP address.', example='118.31.XX.XX'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region of the basic GA instance.', example='ips-bp11ilwqjdkjeg9r7****'),
  ipVersion?: string(name='IpVersion', description='The Internet protocol version. Only **IPv4** may be returned.', example='IPv4'),
  ispType?: string(name='IspType', description='The line type of the elastic IP address (EIP) in the acceleration region. Valid values:

*   **BGP** (default): BGP (Multi-ISP) lines.
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines.

Valid values if you are allowed to use single-ISP bandwidth:

*   **ChinaTelecom**
*   **ChinaUnicom**
*   **ChinaMobile**
*   **ChinaTelecom_L2**
*   **ChinaUnicom_L2**
*   **ChinaMobile_L2**', example='BGP'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6D2BFF54-6AF2-4679-88C4-2F2E187F16CB'),
  state?: string(name='State', description='The status of the acceleration region of the basic GA instance. Valid values:

*   **init**: The acceleration region is being initialized.
*   **active**: The acceleration region is in the running state.
*   **updating**: The acceleration region is being configured.
*   **Deleting**: The acceleration region is being deleted.', example='active'),
}

model GetBasicIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBasicIpSetResponseBody(name='body'),
}

/**
 * @summary Queries the information about the acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBasicIpSetResponse
 */
async function getBasicIpSetWithOptions(request: GetBasicIpSetRequest, runtime: Util.RuntimeOptions): GetBasicIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @param request GetBasicIpSetRequest
 * @return GetBasicIpSetResponse
 */
async function getBasicIpSet(request: GetBasicIpSetRequest): GetBasicIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicIpSetWithOptions(request, runtime);
}

model GetHealthStatusRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance that you want to query.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether only to precheck the request. Valid values:

*   **true**: prechecks the request only. The health status of the listener is not queried. The system prechecks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false** (default): sends a normal request. If the request passes the precheck, a 2xx HTTP status code is returned and the health status of the listener is obtained.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetHealthStatusResponseBody = {
  endpointGroups?: [ 
    {
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
      endpointGroupType?: string(name='EndpointGroupType', description='The type of the endpoint group. Valid values:

*   **default:** the default endpoint group.
*   **virtual:** a virtual endpoint group.', example='default'),
      endpoints?: [ 
        {
          address?: string(name='Address', description='The IP address of the endpoint.', example='47.0.XX.XX'),
          endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-hp33b2e43fays7s8****'),
          healthDetail?: string(name='HealthDetail', description='The health check details of the endpoint.

>  This parameter is unavailable.', example='null'),
          healthStatus?: string(name='HealthStatus', description='The health status of the endpoint. Valid values:

*   **init:** The endpoint is being initialized.
*   **normal:** The endpoint is normal.
*   **abnormal:** The endpoint is abnormal.', example='normal'),
          port?: long(name='Port', description='The port that is used to connect to the endpoint.', example='80'),
          type?: string(name='Type', description='The type of the endpoint. Valid values:

*   **Domain:** a custom domain name.
*   **Ip:** a custom IP address.
*   **PublicIp:** a public IP address provided by Alibaba Cloud.
*   **ECS:** an Elastic Compute Service (ECS) instance.
*   **SLB:** a Classic Load Balancer (CLB) instance.
*   **ALB:** an Application Load Balancer (ALB) instance.
*   **OSS:** an Object Storage Service (OSS) bucket.
*   **ENI:** an elastic network interface (ENI).
*   **NLB:** a Network Load Balancer (NLB) instance.', example='Ip'),
        }
      ](name='Endpoints', description='The information about the endpoints.'),
      forwardingRuleIds?: [ string ](name='ForwardingRuleIds', description='The IDs of the forwarding rules.'),
      healthStatus?: string(name='HealthStatus', description='The health status of the endpoint group. Valid values:

*   **init:** The endpoint group is being initialized.
*   **normal:** The endpoint group is normal.
*   **abnormal:** The endpoint group is abnormal.
*   **partiallyAbnormal:** The endpoint group is partially abnormal.', example='normal'),
    }
  ](name='EndpointGroups', description='The information about the endpoint groups.'),
  healthStatus?: string(name='HealthStatus', description='The health status of endpoints and endpoint groups. Valid values:

*   **normal**
*   **abnormal**
*   **partiallyAbnormal**', example='normal'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model GetHealthStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHealthStatusResponseBody(name='body'),
}

/**
 * @summary Queries the health status of the endpoints and endpoint groups of a listener.
 *
 * @param request GetHealthStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHealthStatusResponse
 */
async function getHealthStatusWithOptions(request: GetHealthStatusRequest, runtime: Util.RuntimeOptions): GetHealthStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHealthStatus',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the health status of the endpoints and endpoint groups of a listener.
 *
 * @param request GetHealthStatusRequest
 * @return GetHealthStatusResponse
 */
async function getHealthStatus(request: GetHealthStatusRequest): GetHealthStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHealthStatusWithOptions(request, runtime);
}

model GetInvalidDomainCountRequest {
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model GetInvalidDomainCountResponseBody = {
  invalidDomainCount?: string(name='InvalidDomainCount', description='The number of invalid domain names.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model GetInvalidDomainCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInvalidDomainCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of invalid domain names.
 *
 * @param request GetInvalidDomainCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInvalidDomainCountResponse
 */
async function getInvalidDomainCountWithOptions(request: GetInvalidDomainCountRequest, runtime: Util.RuntimeOptions): GetInvalidDomainCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInvalidDomainCount',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of invalid domain names.
 *
 * @param request GetInvalidDomainCountRequest
 * @return GetInvalidDomainCountResponse
 */
async function getInvalidDomainCount(request: GetInvalidDomainCountRequest): GetInvalidDomainCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInvalidDomainCountWithOptions(request, runtime);
}

model GetIpsetsBandwidthLimitRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance to be queried.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model GetIpsetsBandwidthLimitResponseBody = {
  bandwidthAllocationType?: string(name='BandwidthAllocationType', description='The type of the bandwidth that is allocated.

*   **ShareBandwidth:** shared bandwidth.
*   **ExclusiveBandwidth:** dedicated bandwidth.', example='ShareBandwidth'),
  bandwidthLimit?: long(name='BandwidthLimit', description='The maximum bandwidth of the acceleration area. Unit: Mbit/s.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model GetIpsetsBandwidthLimitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIpsetsBandwidthLimitResponseBody(name='body'),
}

/**
 * @summary Queries the maximum bandwidth of an acceleration area.
 *
 * @param request GetIpsetsBandwidthLimitRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIpsetsBandwidthLimitResponse
 */
async function getIpsetsBandwidthLimitWithOptions(request: GetIpsetsBandwidthLimitRequest, runtime: Util.RuntimeOptions): GetIpsetsBandwidthLimitResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIpsetsBandwidthLimit',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the maximum bandwidth of an acceleration area.
 *
 * @param request GetIpsetsBandwidthLimitRequest
 * @return GetIpsetsBandwidthLimitResponse
 */
async function getIpsetsBandwidthLimit(request: GetIpsetsBandwidthLimitRequest): GetIpsetsBandwidthLimitResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIpsetsBandwidthLimitWithOptions(request, runtime);
}

model GetSpareIpRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.', example='1F4B6A4A-C89E-489E-BAF1-52777EE148EF'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request.

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  spareIp?: string(name='SpareIp', description='The secondary IP address that is associated with the CNAME. If the acceleration area becomes unavailable, GA redirects traffic to the secondary IP address.

This parameter is required.', example='47.100.XX.XX'),
}

model GetSpareIpResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  state?: string(name='State', description='The status of the secondary IP address. Valid values:

*   **active:** The secondary IP address is available.
*   **inuse:** The secondary IP address is in use.', example='active'),
}

model GetSpareIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSpareIpResponseBody(name='body'),
}

/**
 * @summary Queries the status of a secondary IP address that is associated with a CNAME.
 *
 * @param request GetSpareIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSpareIpResponse
 */
async function getSpareIpWithOptions(request: GetSpareIpRequest, runtime: Util.RuntimeOptions): GetSpareIpResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.spareIp)) {
    query['SpareIp'] = request.spareIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSpareIp',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of a secondary IP address that is associated with a CNAME.
 *
 * @param request GetSpareIpRequest
 * @return GetSpareIpResponse
 */
async function getSpareIp(request: GetSpareIpRequest): GetSpareIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSpareIpWithOptions(request, runtime);
}

model ListAccelerateAreasRequest {
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListAccelerateAreasResponseBody = {
  areas?: [ 
    {
      areaId?: string(name='AreaId', description='The area ID.', example='cn-huabei'),
      localName?: string(name='LocalName', description='The name of the area.', example='North China'),
      regionList?: [ 
        {
          localName?: string(name='LocalName', description='The name of the region.', example='China (Qingdao)'),
          regionId?: string(name='RegionId', description='The region ID.', example='cn-qingdao'),
        }
      ](name='RegionList', description='The regions in the acceleration area.'),
    }
  ](name='Areas', description='The information about the areas.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model ListAccelerateAreasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAccelerateAreasResponseBody(name='body'),
}

/**
 * @summary Queries available acceleration areas and regions.
 *
 * @param request ListAccelerateAreasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAccelerateAreasResponse
 */
async function listAccelerateAreasWithOptions(request: ListAccelerateAreasRequest, runtime: Util.RuntimeOptions): ListAccelerateAreasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAccelerateAreas',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries available acceleration areas and regions.
 *
 * @param request ListAccelerateAreasRequest
 * @return ListAccelerateAreasResponse
 */
async function listAccelerateAreas(request: ListAccelerateAreasRequest): ListAccelerateAreasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAccelerateAreasWithOptions(request, runtime);
}

model ListAcceleratorsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekztkx4zwc****'),
  state?: string(name='State', description='The status of the GA instance. Valid values:

*   **init**: The GA instance is being initialized.
*   **active**: The GA instance is available.
*   **configuring**: The GA instance is being configured.
*   **binding**: The GA instance is being associated.
*   **unbinding**: The GA instance is being disassociated.
*   **deleting**: The GA instance is being deleted.
*   **finacialLocked**: The GA instance is locked due to overdue payments.', example='active'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the GA resource. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value of the GA resource. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='tag-value'),
    }
  ](name='Tag', description='The tags of the GA instance.'),
}

model ListAcceleratorsResponseBody = {
  accelerators?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      bandwidth?: int32(name='Bandwidth', description='The bandwidth of the GA instance. Unit: Mbit/s.', example='5'),
      bandwidthBillingType?: string(name='BandwidthBillingType', description='The bandwidth metering method. Valid values:

*   **BandwidthPackage**: billed based on bandwidth plans.
*   **CDT**: billed based on data transfer.', example='CDT'),
      basicBandwidthPackage?: {
        bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the basic bandwidth plan. Unit: Mbit/s.', example='2'),
        bandwidthType?: string(name='BandwidthType', description='The bandwidth type that is provided by the basic bandwidth plan. Valid values:

*   **Basic**
*   **Enhanced**
*   **Advanced**', example='Basic'),
        instanceId?: string(name='InstanceId', description='The ID of the basic bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
      }(name='BasicBandwidthPackage', description='The information about the basic bandwidth plan that is associated with the GA instance.'),
      cenId?: string(name='CenId', description='The ID of the Cloud Enterprise Network (CEN) instance that is associated with the GA instance.', example='cen-hjfufhjfuwff****'),
      createTime?: long(name='CreateTime', description='The timestamp that indicates when the GA instance was created.', example='1650643200'),
      crossBorderMode?: string(name='CrossBorderMode', description='The type of cross-border acceleration. This parameter is returned for GA instances whose bandwidth metering method is pay-by-data-transfer.

*   **bpgPro**: BGP (Multi-ISP) Pro lines.
*   **private**: cross-border Express Connect circuit.', example='bpgPro'),
      crossBorderStatus?: boolean(name='CrossBorderStatus', description='Indicates whether cross-border acceleration is enabled for the GA instance. Valid values:

*   **true**
*   **false**', example='false'),
      crossDomainBandwidthPackage?: {
        bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the cross-border acceleration bandwidth plan. Unit: Mbit/s.', example='2'),
        instanceId?: string(name='InstanceId', description='The ID of the cross-border acceleration bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
      }(name='CrossDomainBandwidthPackage', description='The information about the cross-border acceleration bandwidth plan that is associated with the GA instance.

This array is returned only for GA instances that are created on the international site (alibabacloud.com).'),
      ddosId?: string(name='DdosId', description='The ID of the Anti-DDoS Pro or Anti-DDOS Premium instance that is associated with the GA instance.', example='ddoscoo-cn-zz11vq7j****'),
      description?: string(name='Description', description='The description of the GA instance.', example='Accelerator'),
      dnsName?: string(name='DnsName', description='The CNAME that is assigned to the GA instance.', example='ga-bp15u1i2hmtbk8c3i****.aliyunga0019.com'),
      expiredTime?: long(name='ExpiredTime', description='The timestamp that indicates when the GA instance expires.', example='1653235200'),
      instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the GA instance.', example='PREPAY'),
      ipSetConfig?: {
        accessMode?: string(name='AccessMode', description='The access mode of the acceleration area. Valid values:

*   **UserDefine**: custom nearby access mode. You can select acceleration areas and regions based on your business requirements. GA allocates a separate elastic IP address (EIP) to each acceleration region.
*   **Anycast**: automatic nearby access mode. You do not need to specify an acceleration area. GA allocates an Anycast EIP to multiple regions across the globe. Users can connect to the nearest access point of the Alibaba Cloud global transmission network by sending requests to the Anycast EIP.', example='UserDefine'),
      }(name='IpSetConfig', description='The configurations of the acceleration area.'),
      name?: string(name='Name', description='The name of the GA instance.', example='Accelerator'),
      regionId?: string(name='RegionId', description='The ID of the region where GA instance is deployed. Only **cn-hangzhou** may be returned.', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekztkx4zwc****'),
      secondDnsName?: string(name='SecondDnsName', description='The CNAME that is used to associate the GA instance with an Anti-DDoS Pro instance or an Anti-DDOS Premium instance.', example='ga-bp1f609c76zg6zuna****-1.aliyunga0047.com'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter takes effect only if the value of **ServiceManaged** is **true**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action that is performed on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if the value of **Action** is **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.
> *   This parameter takes effect only if the value of **ServiceManaged** is **true**.
> *   Users can perform only specific actions on a managed instance.'),
      spec?: string(name='Spec', description='The specification of the GA instance. Valid values:

*   **1**: Small Ⅰ.
*   **2**: Small Ⅱ.
*   **3**: Small Ⅲ.
*   **5**: Medium Ⅰ.
*   **8**: Medium Ⅱ.
*   **10**: Medium Ⅲ.
*   **20**: Large Ⅰ.
*   **30**: Large Ⅱ.
*   **40**: Large Ⅲ.
*   **50**: Large IV.
*   **60**: Large V.
*   **70**: Large VI.
*   **80**: Large VII.
*   **90**: Large VIII.
*   **100**: Super Large Ⅰ.
*   **200**: Super Large Ⅱ.

>  The Large Ⅲ specification and higher specifications are available only to accounts that are added to the whitelist. To use these specifications, contact your Alibaba Cloud account manager.

Different specifications provide different capabilities. For more information, see [Instance specifications](https://help.aliyun.com/document_detail/153127.html).', example='1'),
      state?: string(name='State', description='The status of the GA instance. Valid values:

*   **init**: The GA instance is being initialized.
*   **active**: The GA instance is available.
*   **configuring**: The GA instance is being configured.
*   **binding**: The GA instance is being associated.
*   **unbinding**: The GA instance is being disassociated.
*   **deleting**: The GA instance is being deleted.
*   **finacialLocked**: The GA instance is locked due to overdue payments.', example='active'),
      tags?: [ 
        {
          key?: string(name='Key', description='The key of the tag.', example='test-key'),
          value?: string(name='Value', description='The value of the tag.', example='tast-value'),
        }
      ](name='Tags', description='The tags that are added to the resource.'),
      type?: string(name='Type', description='An invalid parameter.', example='Invalid parameter'),
      upgradableStatus?: string(name='UpgradableStatus', description='Indicates whether the GA instance can be upgraded. Valid values:

*   **notUpgradable**: The GA instance does not need to be upgraded.
*   **upgradable**: The GA instance can be upgraded to the latest version.
*   **upgradeFailed**: The GA instance failed to be upgraded.', example='notUpgradable'),
    }
  ](name='Accelerators', description='The information about the GA instances.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListAcceleratorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAcceleratorsResponseBody(name='body'),
}

/**
 * @summary Queries Global Accelerator (GA) instances.
 *
 * @param request ListAcceleratorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAcceleratorsResponse
 */
async function listAcceleratorsWithOptions(request: ListAcceleratorsRequest, runtime: Util.RuntimeOptions): ListAcceleratorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAccelerators',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries Global Accelerator (GA) instances.
 *
 * @param request ListAcceleratorsRequest
 * @return ListAcceleratorsResponse
 */
async function listAccelerators(request: ListAcceleratorsRequest): ListAcceleratorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAcceleratorsWithOptions(request, runtime);
}

model ListAclsRequest {
  aclIds?: [ string ](name='AclIds', description='The ACL IDs. You can specify a maximum of 20 ACL IDs in each request.'),
  aclName?: string(name='AclName', description='The ACL name. You can specify a maximum of ACL names in each request.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test-acl'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **50**. Default value: **10**.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If this is your first and only query, ignore this parameter.
*   If a subsequent query is to be performed, set the parameter to the value of NextToken that is returned from the last call.', example='caeba0bbb2be03f84eb48b699f0a****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek2lgw4evw****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the ACL. The value of this parameter cannot be an empty string.

The tag key can be up to 64 characters in length, and cannot contain `http://` or `https://`. The tag key cannot start with `aliyun` or `acs:`.

You can specify a maximum of 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value of the ACL. The tag value can be an empty string.

The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. The tag value cannot start with `aliyun` or `acs:`.

You can specify a maximum of 20 tag values.', example='tag-value'),
    }
  ](name='Tag', description='The tag of the ACL.'),
}

model ListAclsResponseBody = {
  acls?: [ 
    {
      aclId?: string(name='AclId', description='The ID of the network ACL.', example='nacl-hp34s2h0xx1ht4nwo****'),
      aclName?: string(name='AclName', description='The name of the network ACL.', example='test-acl'),
      aclStatus?: string(name='AclStatus', description='The status of the network ACL. Valid values:

*   **init**: The network ACL is being initialized.
*   **active**: The network ACL is available.
*   **configuring**: The network ACL is being configured.
*   **updating**: The network ACL is being updated.
*   **deleting:** The network ACL is being deleted.', example='active'),
      addressIPVersion?: string(name='AddressIPVersion', description='The IP version of the network ACL. Valid values:

*   **IPv4**
*   **IPv6**', example='IPv4'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek2lgw4evw****'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the network ACL.', example='tag-key'),
          value?: string(name='Value', description='The tag value of the network ACL.', example='tag-value'),
        }
      ](name='Tags', description='The tags of the network ACL.'),
    }
  ](name='Acls', description='The network ACLs.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If **NextToken** is not returned, it indicates that no additional results exist.
*   If **NextToken** is returned, the value is the token that is used for the next query.', example='FFmyTO70t****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListAclsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAclsResponseBody(name='body'),
}

/**
 * @summary Queries a list of access control lists (ACLs).
 *
 * @param request ListAclsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAclsResponse
 */
async function listAclsWithOptions(request: ListAclsRequest, runtime: Util.RuntimeOptions): ListAclsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!Util.isUnset(request.aclName)) {
    query['AclName'] = request.aclName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAcls',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of access control lists (ACLs).
 *
 * @param request ListAclsRequest
 * @return ListAclsResponse
 */
async function listAcls(request: ListAclsRequest): ListAclsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAclsWithOptions(request, runtime);
}

model ListApplicationMonitorRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='１'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **100**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  searchValue?: string(name='SearchValue', description='The keyword that is used to search for origin probing tasks. You can enter a URL, an IP address, a GA instance ID, or a listener ID to perform a fuzzy match.', example='aliyun'),
}

model ListApplicationMonitorResponseBody = {
  applicationMonitors?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance on which the origin probing task runs.', example='ga-bp1odcab8tmno0hdq****'),
      address?: string(name='Address', description='The URL or IP address that was probed.', example='https://www.aliyun.com'),
      detectEnable?: boolean(name='DetectEnable', description='Indicates whether the automatic diagnostics feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
      detectThreshold?: int32(name='DetectThreshold', description='The threshold that is used to trigger the automatic diagnostics feature.', example='１'),
      detectTimes?: int32(name='DetectTimes', description='The number of times that are required to reach the threshold before the automatic diagnostics feature can be triggered.', example='１'),
      listenerId?: string(name='ListenerId', description='The ID of the listener on which the origin probing task runs.', example='lsr-bp1bpn0kn908w4nbw****'),
      optionsJson?: string(name='OptionsJson', description='The extended options of the listener protocol that is used by the origin probing task. The options vary based on the listener protocol.', example='{ "http_method": "get","header": "key:asd","acceptable_response_code": "500","cert_verify": true }'),
      silenceTime?: int32(name='SilenceTime', description='The silence period of the automatic diagnostics feature. This parameter indicates the interval at which the automatic diagnostics feature is triggered. If the availability rate does not return to normal after GA triggers an automatic diagnostic task, GA must wait until the silence period ends before GA can trigger another automatic diagnostic task.

If the number of consecutive times that the availability rate drops below the threshold of automatic diagnostics reaches the value of **DetectTimes** , the automatic diagnostics feature is triggered. The automatic diagnostics feature is not triggered again within the silence period even if the availability rate stays below the threshold. If the availability rate does not return to normal after the silence period ends, the automatic diagnostics feature is triggered again.

Unit: seconds.', example='300'),
      state?: string(name='State', description='The status of the origin probing task. Valid values:

*   **active:** The origin probing task is running.
*   **inactive:** The origin probing task is stopped.
*   **init:** The origin probing task is being initialized.
*   **deleting:** The origin probing task is being deleted.', example='active'),
      taskId?: string(name='TaskId', description='The origin probing task ID.', example='sm-bp1fpdjfju9k8yr1y****'),
      taskName?: string(name='TaskName', description='The origin probing task name.', example='task1'),
    }
  ](name='ApplicationMonitors', description='The list of origin probing tasks.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Queries origin probing tasks.
 *
 * @param request ListApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationMonitorResponse
 */
async function listApplicationMonitorWithOptions(request: ListApplicationMonitorRequest, runtime: Util.RuntimeOptions): ListApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.searchValue)) {
    query['SearchValue'] = request.searchValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries origin probing tasks.
 *
 * @param request ListApplicationMonitorRequest
 * @return ListApplicationMonitorResponse
 */
async function listApplicationMonitor(request: ListApplicationMonitorRequest): ListApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApplicationMonitorWithOptions(request, runtime);
}

model ListApplicationMonitorDetectResultRequest {
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1638288000'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1640164683'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **100**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  taskId?: string(name='TaskId', description='The origin probing task ID.', example='sm-bp1fpdjfju9k8yr1y****'),
}

model ListApplicationMonitorDetectResultResponseBody = {
  applicationMonitorDetectResultList?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance on which the origin probing task runs.', example='ga-bp1odcab8tmno0hdq****'),
      content?: string(name='Content', description='The response content returned by the origin probing task.', example='502 BadGateway'),
      detail?: string(name='Detail', description='The description of the diagnostic result. Valid values:

*   **All forward nodes work well.:** The origin server is normal.
*   **Endpoint network error.:** The origin server is abnormal. You must check whether the origin server is running as expected.
*   **Public network error.:** An Internet error occurred, which is a network error that occurred when the client connected to the acceleration region.
*   **Ga internal error.:** An internal error occurred. For example, an exception occurred when GA processed a request.
*   **Ga has been deleted.:** The current GA instance is deleted.
*   **Ga state is not stable.:** The current GA instance is in an unstable state, such as the Configuring state.
*   **Ga has no listener configuration.:** No listener is configured for the current GA instance.
*   **Missing endpoint configuration.:** No endpoint is configured.
*   **Missing acceleration region configuration.:** No acceleration region is configured.
*   **Missing endpointgroup configuration.:** No endpoint group is configured.', example='All forward nodes work well'),
      detectTime?: string(name='DetectTime', description='The time when the diagnosis of the origin probing task ends.', example='1663205460'),
      diagStatus?: string(name='DiagStatus', description='The diagnostic result of the origin probing task. Valid values:

*   **success:** The origin probing task succeeded.
*   **failed:** The origin probing task failed.', example='success'),
      listenerId?: string(name='ListenerId', description='The ID of the listener on which the origin probing task runs.', example='lsr-bp1bpn0kn908w4nbw****'),
      port?: string(name='Port', description='The listener port.', example='80'),
      protocol?: string(name='Protocol', description='The network transmission protocol that is used by the listener. Valid values:

*   **tcp:** TCP.
*   **udp:** UDP.
*   **http:** HTTP.
*   **https:** HTTPS.

>  UDP listeners do not support probing.', example='http'),
      statusCode?: string(name='StatusCode', description='The error code returned by the origin probing task.', example='502'),
      taskId?: string(name='TaskId', description='The origin probing task ID.', example='sm-bp1fpdjfju9k8yr1y****'),
    }
  ](name='ApplicationMonitorDetectResultList', description='Details about the diagnostic result of the origin probing task.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListApplicationMonitorDetectResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationMonitorDetectResultResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of origin probing tasks.
 *
 * @param request ListApplicationMonitorDetectResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationMonitorDetectResultResponse
 */
async function listApplicationMonitorDetectResultWithOptions(request: ListApplicationMonitorDetectResultRequest, runtime: Util.RuntimeOptions): ListApplicationMonitorDetectResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplicationMonitorDetectResult',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of origin probing tasks.
 *
 * @param request ListApplicationMonitorDetectResultRequest
 * @return ListApplicationMonitorDetectResultResponse
 */
async function listApplicationMonitorDetectResult(request: ListApplicationMonitorDetectResultRequest): ListApplicationMonitorDetectResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApplicationMonitorDetectResultWithOptions(request, runtime);
}

model ListAvailableAccelerateAreasRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1yeeq8yfoyszmqy****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListAvailableAccelerateAreasResponseBody = {
  areas?: [ 
    {
      areaId?: string(name='AreaId', description='The ID of the acceleration area.', example='cn-huabei'),
      localName?: string(name='LocalName', description='The acceleration area name.', example='North China'),
      regionList?: [ 
        {
          chinaMainland?: boolean(name='ChinaMainland', description='Indicates whether the region is in the Chinese mainland. Valid values:

*   **true**
*   **false**', example='false'),
          ispTypeList?: [ string ](name='IspTypeList', description='The line type of the elastic IP address (EIP) in the acceleration region. Valid values:

*   **BGP**: BGP (Multi-ISP) lines.
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines.'),
          localName?: string(name='LocalName', description='The acceleration region name.', example='China (Qingdao)'),
          multiAz?: boolean(name='MultiAz', description='Indicates whether multiple zones are supported. Valid values:

*   **true**
*   **false**', example='true'),
          regionId?: string(name='RegionId', description='The ID of the acceleration region.', example='cn-qingdao'),
          supportIpv6?: boolean(name='SupportIpv6', description='Indicates whether IPv6 is supported. Valid values:

*   **true**
*   **false**', example='true'),
        }
      ](name='RegionList', description='The information about acceleration regions.'),
    }
  ](name='Areas', description='The information about acceleration areas.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A9B4E54C-9CCD-4002-91A9-D38C6C209192'),
}

model ListAvailableAccelerateAreasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAvailableAccelerateAreasResponseBody(name='body'),
}

/**
 * @summary Queries available acceleration regions.
 *
 * @param request ListAvailableAccelerateAreasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAvailableAccelerateAreasResponse
 */
async function listAvailableAccelerateAreasWithOptions(request: ListAvailableAccelerateAreasRequest, runtime: Util.RuntimeOptions): ListAvailableAccelerateAreasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAvailableAccelerateAreas',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries available acceleration regions.
 *
 * @param request ListAvailableAccelerateAreasRequest
 * @return ListAvailableAccelerateAreasResponse
 */
async function listAvailableAccelerateAreas(request: ListAvailableAccelerateAreasRequest): ListAvailableAccelerateAreasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAvailableAccelerateAreasWithOptions(request, runtime);
}

model ListAvailableBusiRegionsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListAvailableBusiRegionsResponseBody = {
  regions?: [ 
    {
      chinaMainland?: boolean(name='ChinaMainland', description='Indicates whether the region is in the Chinese mainland. Valid values:

*   **true**
*   **false**', example='true'),
      localName?: string(name='LocalName', description='The name of the region.', example='China (Qingdao)'),
      pop?: boolean(name='Pop', description='Indicates whether it is a point of presence (PoP) of Alibaba Cloud. Valid values:

*   **true**
*   **false**', example='false'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-qingdao'),
    }
  ](name='Regions', description='The information about the regions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6'),
}

model ListAvailableBusiRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAvailableBusiRegionsResponseBody(name='body'),
}

/**
 * @summary Queries the available acceleration regions of a Global Accelerator (GA) instance.
 *
 * @param request ListAvailableBusiRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAvailableBusiRegionsResponse
 */
async function listAvailableBusiRegionsWithOptions(request: ListAvailableBusiRegionsRequest, runtime: Util.RuntimeOptions): ListAvailableBusiRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAvailableBusiRegions',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the available acceleration regions of a Global Accelerator (GA) instance.
 *
 * @param request ListAvailableBusiRegionsRequest
 * @return ListAvailableBusiRegionsResponse
 */
async function listAvailableBusiRegions(request: ListAvailableBusiRegionsRequest): ListAvailableBusiRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAvailableBusiRegionsWithOptions(request, runtime);
}

model ListBandwidthPackagesRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **100**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek2ry6mp2c****'),
  state?: string(name='State', description='The status of the bandwidth plan. Valid values:

*   **init**: The bandwidth plan is being initialized.
*   **active**: The bandwidth plan is available.
*   **binded**: The bandwidth plan is associated.
*   **binding**: The bandwidth plan is being associated.
*   **unbinding**: The bandwidth plan is being disassociated.
*   **updating**: The bandwidth plan is being updated.
*   **finacialLocked**: The bandwidth plan is locked due to overdue payments.
*   **locked**: The bandwidth plan is locked.', example='active'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the bandwidth plan. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='tag-key'),
      value?: string(name='Value', description='The tag value of the bandwidth plan. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='tag-value'),
    }
  ](name='Tag', description='The tag of the bandwidth plan.'),
  type?: string(name='Type', description='The type of the bandwidth plan. Valid values:

*   **Basic**: a basic bandwidth plan
*   **CrossDomain**: a cross-border acceleration bandwidth plan

If you call this operation on the China site (aliyun.com), you can set Type only to **Basic**.', example='Basic'),
}

model ListBandwidthPackagesResponseBody = {
  bandwidthPackages?: [ 
    {
      accelerators?: [ string ](name='Accelerators', description='The IDs of the GA instances that are associated with the bandwidth plans.'),
      bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the bandwidth plan. Unit: Mbit/s.', example='2'),
      bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
      bandwidthType?: string(name='BandwidthType', description='The type of the bandwidth. Valid values:

*   **Basic**
*   **Enhanced**
*   **Advanced**', example='Basic'),
      billingType?: string(name='BillingType', description='The metering method that is used when you use the pay-as-you-go billing method.

*   **PayByTraffic**: pay-by-data-transfer.
*   **PayBY95**: pay-by-95th-percentile.', example='PayByTraffic'),
      cbnGeographicRegionIdA?: string(name='CbnGeographicRegionIdA', description='Area A of the cross-region acceleration bandwidth plan. **China-mainland** is returned.

This parameter is returned only if you call the operation on the international site (alibabacloud.com).', example='China-mainland'),
      cbnGeographicRegionIdB?: string(name='CbnGeographicRegionIdB', description='Area B of the cross-region acceleration bandwidth plan. **Global** is returned.

This parameter is returned only if you call the operation on the international site (alibabacloud.com).', example='Global'),
      chargeType?: string(name='ChargeType', description='The billing method of the bandwidth plan.

*   **PREPAY**: subscription. This is the default value.
*   **POSTPAY**: pay-as-you-go.', example='PREPAY'),
      createTime?: string(name='CreateTime', description='The time when the bandwidth plan was created.', example='1578966918000'),
      description?: string(name='Description', description='The description of the bandwidth plan.', example='testDescription'),
      expiredTime?: string(name='ExpiredTime', description='The expiration time of the bandwidth plan.', example='1578966918000'),
      name?: string(name='Name', description='The name of the bandwidth plan.', example='testName'),
      ratio?: int32(name='Ratio', description='The percentage of the guaranteed minimum bandwidth if the pay-by-95th-percentile metering method is used.', example='30'),
      regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. **cn-hangzhou** is returned.', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek2ry6mp2c****'),
      state?: string(name='State', description='The status of the bandwidth plan. Valid values:

*   **init:** The bandwidth plan is being initialized.
*   **active:** The bandwidth plan is available.
*   **binded:** The bandwidth plan is associated with a GA instance.
*   **binding:** The bandwidth plan is being associated with a GA instance.
*   **unbinding:** The bandwidth plan is being disassociated from a GA instance.
*   **updating:** The bandwidth plan is being updated.
*   **finacialLocked:** The bandwidth plan is locked due to overdue payments.
*   **locked**: The bandwidth plan is locked.', example='active'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the bandwidth plan.', example='tag-key'),
          value?: string(name='Value', description='The tag value of the bandwidth plan.', example='tag-value'),
        }
      ](name='Tags', description='The tag of the bandwidth plan.'),
      type?: string(name='Type', description='The type of the bandwidth plan. Valid values:

*   **Basic:** a basic bandwidth plan.
*   **CrossDomain:** a cross-region acceleration bandwidth plan.

If you call the operation on the China site (aliyun.com), **Basic** is returned.', example='Basic'),
    }
  ](name='BandwidthPackages', description='The details of the bandwidth plans.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4B6DBBB0-2D01-4C6A-A384-4129266E6B78'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListBandwidthPackagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBandwidthPackagesResponseBody(name='body'),
}

/**
 * @summary Queries bandwidth plans.
 *
 * @param request ListBandwidthPackagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBandwidthPackagesResponse
 */
async function listBandwidthPackagesWithOptions(request: ListBandwidthPackagesRequest, runtime: Util.RuntimeOptions): ListBandwidthPackagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBandwidthPackages',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries bandwidth plans.
 *
 * @param request ListBandwidthPackagesRequest
 * @return ListBandwidthPackagesResponse
 */
async function listBandwidthPackages(request: ListBandwidthPackagesRequest): ListBandwidthPackagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBandwidthPackagesWithOptions(request, runtime);
}

model ListBandwidthackagesRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **100**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListBandwidthackagesResponseBody = {
  bandwidthPackages?: [ 
    {
      accelerators?: [ string ](name='Accelerators', description='The IDs of the GA instances that are associated with the bandwidth plans.'),
      bandwidth?: int32(name='Bandwidth', description='The bandwidth of the bandwidth plan. Unit: Mbit/s.', example='2'),
      bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
      chargeType?: string(name='ChargeType', description='The billing method of the bandwidth plan. Valid values:

*   **PREPAY**: subscription. This is the default value.
*   **POSTPAY**: pay-as-you-go.', example='PREPAY'),
      createTime?: string(name='CreateTime', description='The time when the bandwidth plan was created.', example='1578966918000'),
      description?: string(name='Description', description='The description of the bandwidth plan.', example='testDescription'),
      expiredTime?: string(name='ExpiredTime', description='The expiration time of the bandwidth plan.', example='1578966918000'),
      name?: string(name='Name', description='The name of the GA instance.', example='Accelerator'),
      regionId?: string(name='RegionId', description='The request ID.', example='DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzzwgr7vz2liy'),
      state?: string(name='State', description='The status of the bandwidth plan. Valid values:

*   **init:** The bandwidth plan is being initialized.
*   **active:** The bandwidth plan is available.
*   **binded:** The bandwidth plan is associated with a GA instance.
*   **binding:** The bandwidth plan is being associated with a GA instance.
*   **unbinding:** The bandwidth plan is being disassociated from a GA instance.
*   **updating:** The bandwidth plan is being updated.
*   **finacialLocked:** The bandwidth plan is locked due to overdue payments.
*   **locked:** The bandwidth plan is locked.', example='active'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the bandwidth plan.', example='tag-key'),
          value?: string(name='Value', description='The tag value of the bandwidth plan.', example='tag-value'),
        }
      ](name='Tags', description='The tag of the bandwidth plan.'),
    }
  ](name='BandwidthPackages', description='The details of the bandwidth plans.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4B6DBBB0-2D01-4C6A-A384-4129266E6B78'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListBandwidthackagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBandwidthackagesResponseBody(name='body'),
}

/**
 * @summary Queries bandwidth plans.
 *
 * @description To query the detailed information about a bandwidth plan, call the **ListBandwidthPackages** operation. For more information, see [ListBandwidthPackages](https://help.aliyun.com/document_detail/2253239.html).
 *
 * @param request ListBandwidthackagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBandwidthackagesResponse
 */
async function listBandwidthackagesWithOptions(request: ListBandwidthackagesRequest, runtime: Util.RuntimeOptions): ListBandwidthackagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBandwidthackages',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries bandwidth plans.
 *
 * @description To query the detailed information about a bandwidth plan, call the **ListBandwidthPackages** operation. For more information, see [ListBandwidthPackages](https://help.aliyun.com/document_detail/2253239.html).
 *
 * @param request ListBandwidthackagesRequest
 * @return ListBandwidthackagesResponse
 */
async function listBandwidthackages(request: ListBandwidthackagesRequest): ListBandwidthackagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBandwidthackagesWithOptions(request, runtime);
}

model ListBasicAccelerateIpEndpointRelationsRequest {
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.', example='gaip-bp1****'),
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **50**. Default value: **10**.', example='10'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If this is your first query or no next query is to be sent, ignore this parameter.
*   If a next query is to be sent, set the value to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListBasicAccelerateIpEndpointRelationsResponseBody = {
  accelerateIpEndpointRelations?: [ 
    {
      accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address.', example='gaip-bp1****'),
      acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp1miyl2kn2racucvegr5'),
      endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
      endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
      endpointName?: string(name='EndpointName', description='The name of the endpoint.', example='ep01'),
      endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, **EndpointSubAddress** returns the primary or secondary private IP address of the primary ENI.
*   If the endpoint type is **ENI**, **EndpointSubAddress** returns the primary or secondary private IP address of the secondary ENI.
*   If the endpoint type is **NLB**, **EndpointSubAddress** returns the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
      endpointSubAddressType?: string(name='EndpointSubAddressType', description='The type of the secondary address of the endpoint.

*   **primary**: a primary private IP address.
*   **secondary**: a secondary private IP address.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**. If the endpoint type is set to **NLB**, **primary** is returned.', example='primary'),
      endpointType?: string(name='EndpointType', description='The type of endpoint. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.
*   **NLB**: Network Load Balancer (NLB) instance.', example='NLB'),
      endpointZoneId?: string(name='EndpointZoneId', description='The ID of the zone where the endpoint is created.

This parameter is returned only when the endpoint type is **NLB**.', example='cn-hangzhou-g'),
      ipAddress?: string(name='IpAddress', description='The accelerated IP address of the basic GA instance.', example='116.132.XX.XX'),
      state?: string(name='State', description='The association status between the accelerated IP address and endpoint.

A value of **active** indicates that the accelerated IP address is associated with the endpoint.', example='active'),
    }
  ](name='AccelerateIpEndpointRelations', description='A list of accelerated IP addresses and the endpoints with which the accelerated IP addresses are associated.'),
  maxResults?: string(name='MaxResults', description='The number of entries returned per page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If **NextToken** is not returned, it indicates that no additional results exist.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListBasicAccelerateIpEndpointRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBasicAccelerateIpEndpointRelationsResponseBody(name='body'),
}

/**
 * @summary Queries whether the accelerated IP address of a basic Global Accelerator (GA) instance is associated with an endpoint.
 *
 * @param request ListBasicAccelerateIpEndpointRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBasicAccelerateIpEndpointRelationsResponse
 */
async function listBasicAccelerateIpEndpointRelationsWithOptions(request: ListBasicAccelerateIpEndpointRelationsRequest, runtime: Util.RuntimeOptions): ListBasicAccelerateIpEndpointRelationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBasicAccelerateIpEndpointRelations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether the accelerated IP address of a basic Global Accelerator (GA) instance is associated with an endpoint.
 *
 * @param request ListBasicAccelerateIpEndpointRelationsRequest
 * @return ListBasicAccelerateIpEndpointRelationsResponse
 */
async function listBasicAccelerateIpEndpointRelations(request: ListBasicAccelerateIpEndpointRelationsRequest): ListBasicAccelerateIpEndpointRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBasicAccelerateIpEndpointRelationsWithOptions(request, runtime);
}

model ListBasicAccelerateIpsRequest {
  accelerateIpAddress?: string(name='AccelerateIpAddress', description='The accelerated IP address of the basic GA instance.', example='116.132.XX.XX'),
  accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address of the basic GA instance.', example='gaip-bp1****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.

You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/2253380.html) operation to query the ID of the acceleration region.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **50**. Default value: **10**.', example='10'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If this is your first query and no next queries are to be sent, ignore this parameter.
*   If a subsequent query is to be sent, set the parameter to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListBasicAccelerateIpsResponseBody = {
  accelerateIps?: [ 
    {
      accelerateIpAddress?: string(name='AccelerateIpAddress', description='The accelerated IP address of the basic GA instance.', example='116.132.XX.XX'),
      accelerateIpId?: string(name='AccelerateIpId', description='The ID of the accelerated IP address of the basic GA instance.', example='gaip-bp1****'),
      acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
      ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.', example='ips-bp11r5jb8ogp122xl****'),
      state?: string(name='State', description='The status of the accelerated IP address. Valid values:

*   **active**: The accelerated IP address is available.
*   **binding**: The accelerated IP address is being associated.
*   **bound**: The accelerated IP address is associated.
*   **unbinding**: The accelerated IP address is being disassociated.
*   **deleting**: The accelerated IP address is being deleted.

>  This parameter is unavailable when the accelerated IP address is being created.', example='active'),
    }
  ](name='AccelerateIps', description='The accelerated IP addresses of the basic GA instance.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned on each page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If **NextToken** was not returned, it indicates that no additional results exist.
*   If **NextToken** was returned in the previous query, specify the value to obtain the next set of results.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListBasicAccelerateIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBasicAccelerateIpsResponseBody(name='body'),
}

/**
 * @summary Queries the accelerated IP addresses in the acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @param request ListBasicAccelerateIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBasicAccelerateIpsResponse
 */
async function listBasicAccelerateIpsWithOptions(request: ListBasicAccelerateIpsRequest, runtime: Util.RuntimeOptions): ListBasicAccelerateIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accelerateIpAddress)) {
    query['AccelerateIpAddress'] = request.accelerateIpAddress;
  }
  if (!Util.isUnset(request.accelerateIpId)) {
    query['AccelerateIpId'] = request.accelerateIpId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBasicAccelerateIps',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the accelerated IP addresses in the acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @param request ListBasicAccelerateIpsRequest
 * @return ListBasicAccelerateIpsResponse
 */
async function listBasicAccelerateIps(request: ListBasicAccelerateIpsRequest): ListBasicAccelerateIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBasicAccelerateIpsWithOptions(request, runtime);
}

model ListBasicAcceleratorsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region to which the basic GA instance belongs. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the basic GA instance belongs.', example='rg-aekzrnd67gq****'),
  state?: string(name='State', description='The state of the basic GA instance. Valid values:

*   **init**: The basic GA instance is being initialized.
*   **active**: The basic GA instance is available.
*   **configuring**: The basic GA instance is being configured.
*   **binding**: The basic GA instance is being associated.
*   **unbinding**: The basic GA instance is being disassociated.
*   **deleting**: The basic GA instance is being deleted.
*   **finacialLocked**: The basic GA instance is locked due to overdue payments.', example='active'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N of the basic GA instance. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='Keytest'),
      value?: string(name='Value', description='The value of tag N of the basic GA instance. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='Valuetest'),
    }
  ](name='Tag', description='The tags of the GA instance.'),
}

model ListBasicAcceleratorsResponseBody = {
  accelerators?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
      bandwidthBillingType?: string(name='BandwidthBillingType', description='The bandwidth billing method.

*   **BandwidthPackage**: billed based on bandwidth plans.
*   **CDT**: billed through Cloud Data Transfer (CDT) and based on data transfer.
*   **CDT95**: billed through CDT and based on the 95th percentile bandwidth. This bandwidth billing method is available only for users that are included in the whitelist.', example='BandwidthPackage'),
      basicBandwidthPackage?: {
        bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the basic bandwidth plan. Unit: Mbit/s.', example='2'),
        bandwidthType?: string(name='BandwidthType', description='The type of the bandwidth that is provided by the basic bandwidth plan.

*   **Basic**: basic
*   **Enhanced**: enhanced
*   **Advanced**: premium', example='Basic'),
        instanceId?: string(name='InstanceId', description='The ID of the basic bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
      }(name='BasicBandwidthPackage', description='Details about the basic bandwidth plan that is associated with the basic GA instance.'),
      basicEndpointGroupId?: string(name='BasicEndpointGroupId', description='The ID of the endpoint group that is associated with the basic GA instance.', example='epg-bp1dmlohjjz4kqaun****'),
      basicIpSetId?: string(name='BasicIpSetId', description='The ID of the acceleration region where the basic GA instance is deployed.', example='ips-bp11ilwqjdkjeg9r7****'),
      createTime?: long(name='CreateTime', description='The timestamp that indicates when the basic GA instance was created.

The time follows the UNIX time format. It is the number of seconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1637734547'),
      crossBorderStatus?: boolean(name='CrossBorderStatus', description='Indicates whether cross-border acceleration is enabled for the GA instance. Valid values:

*   **true**
*   **false**', example='false'),
      crossDomainBandwidthPackage?: {
        bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the cross-region acceleration bandwidth plan. Unit: Mbit/s.', example='2'),
        instanceId?: string(name='InstanceId', description='The ID of the cross-region acceleration bandwidth plan.', example='gbwp-bp1d8xk8bg139j0fw****'),
      }(name='CrossDomainBandwidthPackage', description='Details about the cross-region acceleration bandwidth plan that is associated with the GA instance.

This parameter is returned only when you call this operation on the International site (alibabacloud.com).'),
      description?: string(name='Description', description='The description of the basic GA instance.', example='BasicAccelerator'),
      expiredTime?: long(name='ExpiredTime', description='The timestamp that indicates when the basic GA instance expires.

The time follows the UNIX time format. It is the number of seconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1640326547'),
      instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the basic GA instance. Only **PREPAY** is returned, which indicates the subscription billing method.', example='PREPAY'),
      name?: string(name='Name', description='The name of the basic GA instance.', example='BasicAccelerator'),
      regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed.', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the basic GA instance belongs.', example='rg-aekzrnd67gq****'),
      state?: string(name='State', description='The state of the basic GA instance.

*   **init**: The basic GA instance is being initialized.
*   **active**: The basic GA instance is available.
*   **configuring**: The basic GA instance is being configured.
*   **binding**: The basic GA instance is being associated.
*   **unbinding**: The GA instance is being disassociated.
*   **deleting**: The basic GA instance is being deleted.
*   **finacialLocked**: The basic GA instance is locked due to overdue payments.', example='active'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the basic GA instance.', example='Keytest'),
          value?: string(name='Value', description='The tag value of the basic GA instance.', example='Valuetest'),
        }
      ](name='Tags', description='The tags of the basic GA instance.'),
      type?: string(name='Type', description='This parameter is invalid.', example='None'),
    }
  ](name='Accelerators', description='The information about basic GA instances.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  totalCount?: int32(name='TotalCount', description='The total number of basic GA instances returned.', example='1'),
}

model ListBasicAcceleratorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBasicAcceleratorsResponseBody(name='body'),
}

/**
 * @summary Queries basic Global Accelerator (GA) instances.
 *
 * @param request ListBasicAcceleratorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBasicAcceleratorsResponse
 */
async function listBasicAcceleratorsWithOptions(request: ListBasicAcceleratorsRequest, runtime: Util.RuntimeOptions): ListBasicAcceleratorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBasicAccelerators',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries basic Global Accelerator (GA) instances.
 *
 * @param request ListBasicAcceleratorsRequest
 * @return ListBasicAcceleratorsResponse
 */
async function listBasicAccelerators(request: ListBasicAcceleratorsRequest): ListBasicAcceleratorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBasicAcceleratorsWithOptions(request, runtime);
}

model ListBasicEndpointsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint that you want to query belongs.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint that you want to query.', example='ep-bp14sz7ftcwwjgrdm****'),
  endpointType?: string(name='EndpointType', description='The type of endpoint that you want to query. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.
*   **NLB**: Network Load Balancer (NLB) instance.', example='ENI'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **50**. Default value: **10**.', example='10'),
  name?: string(name='Name', description='The name of the endpoint that you want to query.

The name must be 1 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.', example='ep01'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If this is your first query or no next query is to be sent, ignore this parameter.
*   If a next query is to be sent, set the value to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListBasicEndpointsResponseBody = {
  endpoints?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.', example='ga-bp17frjjh0udz4qz****'),
      endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint belongs.', example='epg-bp1dmlohjjz4kqaun****'),
      endpointId?: string(name='EndpointId', description='The ID of the endpoint that is associated with the basic GA instance.', example='ep-bp14sz7ftcwwjgrdm****'),
      endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is returned if the endpoint type is **ECS**, **ENI**, or **NLB**.

*   If the endpoint type is **ECS**, **EndpointSubAddress** returns the primary or secondary private IP address of the primary ENI.
*   If the endpoint type is **ENI**, **EndpointSubAddress** returns the primary or secondary private IP address of the secondary ENI.
*   If the endpoint type is **NLB**, **EndpointSubAddress** returns the primary private IP address of the NLB backend server.', example='172.16.XX.XX'),
      endpointSubAddressType?: string(name='EndpointSubAddressType', description='The secondary address type of the endpoint.

*   **primary**: a primary private IP address.
*   **secondary**: a secondary private IP address.

This parameter is returned if the type of the endpoint is set to **ECS**, **ENI**, or **NLB**. If the endpoint type is set to **NLB**, **primary** is returned.', example='primary'),
      endpointType?: string(name='EndpointType', description='The type of endpoint. Valid values:

*   **ENI**: ENI.
*   **SLB**: CLB instance.
*   **ECS**: ECS instance.
*   **NLB**: NLB instance.', example='ENI'),
      endpointZoneId?: string(name='EndpointZoneId', description='The zone ID of the endpoint.

This parameter is returned only when the endpoint type is set to **NLB**.', example='cn-hangzhou-g'),
      name?: string(name='Name', description='The name of the endpoint.', example='ep01'),
      state?: string(name='State', description='The status of the endpoint. Valid values:

*   **init**: The endpoint is being initialized.
*   **active**: The endpoint is available.
*   **updating**: The endpoint is being configured.
*   **binding**: The endpoint is being associated.
*   **unbinding**: The endpoint is being disassociated.
*   **deleting**: The endpoint is being deleted.
*   **bound**: The endpoint is associated.', example='active'),
    }
  ](name='Endpoints', description='The endpoints that are associated with the basic GA instance.'),
  maxResults?: string(name='MaxResults', description='The number of entries returned per page.', example='10'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If **NextToken** is not returned, it indicates that no additional results exist.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListBasicEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBasicEndpointsResponseBody(name='body'),
}

/**
 * @summary Queries the endpoints that are associated with a basic Global Accelerator (GA) instance.
 *
 * @param request ListBasicEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBasicEndpointsResponse
 */
async function listBasicEndpointsWithOptions(request: ListBasicEndpointsRequest, runtime: Util.RuntimeOptions): ListBasicEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.endpointType)) {
    query['EndpointType'] = request.endpointType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBasicEndpoints',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the endpoints that are associated with a basic Global Accelerator (GA) instance.
 *
 * @param request ListBasicEndpointsRequest
 * @return ListBasicEndpointsResponse
 */
async function listBasicEndpoints(request: ListBasicEndpointsRequest): ListBasicEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBasicEndpointsWithOptions(request, runtime);
}

model ListBusiRegionsRequest {
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListBusiRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='China (Hangzhou)'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
    }
  ](name='Regions', description='The information about the acceleration regions that are supported by GA.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model ListBusiRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBusiRegionsResponseBody(name='body'),
}

/**
 * @summary Queries the acceleration regions that are supported by Global Accelerator (GA).
 *
 * @param request ListBusiRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBusiRegionsResponse
 */
async function listBusiRegionsWithOptions(request: ListBusiRegionsRequest, runtime: Util.RuntimeOptions): ListBusiRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBusiRegions',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the acceleration regions that are supported by Global Accelerator (GA).
 *
 * @param request ListBusiRegionsRequest
 * @return ListBusiRegionsResponse
 */
async function listBusiRegions(request: ListBusiRegionsRequest): ListBusiRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBusiRegionsWithOptions(request, runtime);
}

model ListCommonAreasRequest {
  ipVersion?: string(name='IpVersion', description='The IP version used to connect to the GA instance. Valid values:

*   **IPv4** (default)
*   **IPv6**', example='IPv4'),
  isEpg?: boolean(name='IsEpg', description='Specifies whether to query regions where endpoint groups of GA can be deployed. Valid values:

*   **true**: yes
*   **false** (default): no', example='true'),
  isIpSet?: boolean(name='IsIpSet', description='Specifies whether to query regions supported by GA. Valid values:

*   **true**
*   **false** (default)', example='true'),
}

model ListCommonAreasResponseBody = {
  areas?: [ 
    {
      areaId?: string(name='AreaId', description='The area ID.', example='cn-huabei'),
      localName?: string(name='LocalName', description='The area name.', example='North China'),
      regionList?: [ 
        {
          localName?: string(name='LocalName', description='The region name.', example='China (Qingdao)'),
          regionId?: string(name='RegionId', description='The region ID.', example='cn-qingdao'),
        }
      ](name='RegionList', description='The information about the regions.'),
    }
  ](name='Areas', description='The information about the areas.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6'),
}

model ListCommonAreasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCommonAreasResponseBody(name='body'),
}

/**
 * @summary Queries available acceleration areas and regions.
 *
 * @description You can call this operation to query the acceleration areas and regions that you can specify on the wizard page of Global Accelerator (GA) and for free-trial GA instances. You can filter acceleration areas and regions based on specified conditions.
 *
 * @param request ListCommonAreasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCommonAreasResponse
 */
async function listCommonAreasWithOptions(request: ListCommonAreasRequest, runtime: Util.RuntimeOptions): ListCommonAreasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipVersion)) {
    query['IpVersion'] = request.ipVersion;
  }
  if (!Util.isUnset(request.isEpg)) {
    query['IsEpg'] = request.isEpg;
  }
  if (!Util.isUnset(request.isIpSet)) {
    query['IsIpSet'] = request.isIpSet;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCommonAreas',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries available acceleration areas and regions.
 *
 * @description You can call this operation to query the acceleration areas and regions that you can specify on the wizard page of Global Accelerator (GA) and for free-trial GA instances. You can filter acceleration areas and regions based on specified conditions.
 *
 * @param request ListCommonAreasRequest
 * @return ListCommonAreasResponse
 */
async function listCommonAreas(request: ListCommonAreasRequest): ListCommonAreasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCommonAreasWithOptions(request, runtime);
}

model ListCustomRoutingEndpointGroupDestinationsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp16jdc00bhe97sr5****'),
  fromPort?: int32(name='FromPort', description='The start port of the backend service port range of the endpoint group.

Valid values: **1** to **65499**. The **FromPort** value must be smaller than or equal to the **ToPort** value.', example='80'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **50**. Default value: **10**.', example='10'),
  protocols?: [ string ](name='Protocols', description='The backend service protocols of the endpoint group. Valid values:

- **TCP**: TCP.
- **UDP**: UDP.
- **TCP,UDP**: TCP and UDP.

If this parameter is empty, all types of protocols are queried.

You can specify up to 10 protocols.'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  toPort?: int32(name='ToPort', description='The end port of the backend service port range of the endpoint group.

Valid values: **1** to **65499**. The **FromPort** value must be smaller than or equal to the **ToPort** value.', example='80'),
}

model ListCustomRoutingEndpointGroupDestinationsResponseBody = {
  destinations?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.', example='ga-bp1odcab8tmno0hdq****'),
      destinationId?: string(name='DestinationId', description='The ID of the endpoint group mapping.', example='dst-123abc****'),
      endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.', example='epg-bp14sz7ftcwwjgrdm****'),
      fromPort?: int32(name='FromPort', description='The first port of the backend service port range.', example='80'),
      listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
      protocols?: [ string ](name='Protocols', description='The backend service protocols of the endpoint group. Valid values:

*   **TCP**
*   **UDP**
*   **TCP,UDP**'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the GA instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   true
*   false', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action that you can perform on the managed instance. Valid values:

*   **Create**: Create an instance.
*   **Update**: Update the current instance.
*   **Delete**: Delete the current instance.
*   **Associate**: Reference the current instance.
*   **UserUnmanaged**: Unmanage the instance.
*   **CreateChild**: Create a child resource in the current instance.', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if **Action** is set to **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and you cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and you can perform the specified actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that you can perform on the managed instance.

>  - This parameter takes effect only if **ServiceManaged** is set to **True**.
>  - You can perform only specific actions on the managed instance.'),
      toPort?: int32(name='ToPort', description='The last port of the backend service port range.', example='80'),
    }
  ](name='Destinations', description='The details about the endpoint group mappings.'),
  pageNumber?: int32(name='PageNumber', description='The number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListCustomRoutingEndpointGroupDestinationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomRoutingEndpointGroupDestinationsResponseBody(name='body'),
}

/**
 * @summary Queries endpoint group mapping configurations of a custom routing listener of a Global Accelerator (GA) instance.
 *
 * @param request ListCustomRoutingEndpointGroupDestinationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomRoutingEndpointGroupDestinationsResponse
 */
async function listCustomRoutingEndpointGroupDestinationsWithOptions(request: ListCustomRoutingEndpointGroupDestinationsRequest, runtime: Util.RuntimeOptions): ListCustomRoutingEndpointGroupDestinationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.fromPort)) {
    query['FromPort'] = request.fromPort;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.protocols)) {
    query['Protocols'] = request.protocols;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.toPort)) {
    query['ToPort'] = request.toPort;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomRoutingEndpointGroupDestinations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries endpoint group mapping configurations of a custom routing listener of a Global Accelerator (GA) instance.
 *
 * @param request ListCustomRoutingEndpointGroupDestinationsRequest
 * @return ListCustomRoutingEndpointGroupDestinationsResponse
 */
async function listCustomRoutingEndpointGroupDestinations(request: ListCustomRoutingEndpointGroupDestinationsRequest): ListCustomRoutingEndpointGroupDestinationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomRoutingEndpointGroupDestinationsWithOptions(request, runtime);
}

model ListCustomRoutingEndpointGroupsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  accessLogSwitch?: string(name='AccessLogSwitch', description='Specifies whether the access log feature is enabled.

You can set the parameter to **on**.

If you leave the parameter empty, all endpoint groups are returned.', example='on'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
  listenerId?: string(name='ListenerId', description='The ID of the custom routing listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListCustomRoutingEndpointGroupsResponseBody = {
  endpointGroups?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      description?: string(name='Description', description='The description of the endpoint group.', example='EndpointGroup'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
      endpointGroupIpList?: [ string ](name='EndpointGroupIpList', description='The endpoint group IP addresses.'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region where the endpoint group is created.', example='cn-hangzhou'),
      endpointGroupUnconfirmedIpList?: [ string ](name='EndpointGroupUnconfirmedIpList', description='The endpoint group IP addresses to be confirmed after the GA instance is upgraded.'),
      listenerId?: string(name='ListenerId', description='The ID of the custom routing listener.', example='lsr-bp1bpn0kn908w4nbw****'),
      name?: string(name='Name', description='The name of the endpoint group.', example='group1'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener
*   **IpSet**: acceleration region
*   **EndpointGroup**: endpoint group
*   **ForwardingRule**: forwarding rule
*   **Endpoint**: endpoint
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener

>  This parameter takes effect only if **Action** is set to **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true**: Users cannot perform the specified actions on the managed instance.
*   **false**: Users can perform the specified actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

> 

*   This parameter takes effect only if **ServiceManaged** is set to **True**.

*   Users can perform only specific actions on a managed instance.'),
      state?: string(name='State', description='The status of the endpoint group. Valid values:

*   **init**
*   **active**
*   **updating**
*   **deleting**', example='active'),
    }
  ](name='EndpointGroups', description='The configuration information about the endpoint group.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListCustomRoutingEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomRoutingEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Queries the endpoint groups that are associated with a custom routing listener.
 *
 * @description ## Debugging
 * [OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code for different SDKs.](https://api.aliyun.com/#product=Ga\\&api=ListCustomRoutingEndpointGroups\\&type=RPC\\&version=2019-11-20)
 *
 * @param request ListCustomRoutingEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomRoutingEndpointGroupsResponse
 */
async function listCustomRoutingEndpointGroupsWithOptions(request: ListCustomRoutingEndpointGroupsRequest, runtime: Util.RuntimeOptions): ListCustomRoutingEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.accessLogSwitch)) {
    query['AccessLogSwitch'] = request.accessLogSwitch;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomRoutingEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the endpoint groups that are associated with a custom routing listener.
 *
 * @description ## Debugging
 * [OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code for different SDKs.](https://api.aliyun.com/#product=Ga\\&api=ListCustomRoutingEndpointGroups\\&type=RPC\\&version=2019-11-20)
 *
 * @param request ListCustomRoutingEndpointGroupsRequest
 * @return ListCustomRoutingEndpointGroupsResponse
 */
async function listCustomRoutingEndpointGroups(request: ListCustomRoutingEndpointGroupsRequest): ListCustomRoutingEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomRoutingEndpointGroupsWithOptions(request, runtime);
}

model ListCustomRoutingEndpointTrafficPoliciesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance to which the traffic policies belong.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  address?: string(name='Address', description='The IP address of the traffic destination.', example='10.0.XX.XX'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the traffic policies belong.', example='lsr-bp1bpn0kn908w4nbw****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint to which the traffic policies belong.', example='ep-bp16jdc00bhe97sr5****'),
  listenerId?: string(name='ListenerId', description='The ID of the listener to which the traffic policies belong.', example='lsr-bp1bpn0kn908w4nbw****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListCustomRoutingEndpointTrafficPoliciesResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  policies?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance to which the endpoint belongs.', example='ga-bp1odcab8tmno0hdq****'),
      address?: string(name='Address', description='The IP addresses of the traffic policies.', example='10.0.XX.XX'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint belongs.', example='lsr-bp1bpn0kn908w4nbw****'),
      endpointId?: string(name='EndpointId', description='The ID of the endpoint to which the traffic policy belongs.', example='ep-bp14sz7ftcwwjgrdm****'),
      listenerId?: string(name='ListenerId', description='The ID of the custom routing listener to which the endpoint belongs.', example='lsr-bp1bpn0kn908w4nbw****'),
      policyId?: string(name='PolicyId', description='The ID of the traffic policy.', example='ply-bp1dmlohjjz4kqaun****'),
      portRanges?: [ 
        {
          fromPort?: int32(name='FromPort', description='The first port of the port range used by the traffic destination to process requests.', example='80'),
          toPort?: int32(name='ToPort', description='The last port of the port range used by the traffic destination to process requests.', example='80'),
        }
      ](name='PortRanges', description='The port range of the traffic policy.'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter is returned only if the value of **ServiceManaged** is **true**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the instance is managed. Valid values:

*   **true**: The GA instance is managed.
*   **false**: The GA instance is not managed.', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**: Create an instance.
*   **Update**: Update the current instance.
*   **Delete**: Delete the current instance.
*   **Associate**: Reference the current instance.
*   **UserUnmanaged**: Unmanage the instance.
*   **CreateChild**: Create a child resource in the current instance.', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter is returned only if the value of **Action** is **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

> *   This parameter is returned only if the value of **ServiceManaged** is **true**.
>*   Users can perform only specific actions on a managed instance.'),
    }
  ](name='Policies', description='A list of traffic policies.'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListCustomRoutingEndpointTrafficPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomRoutingEndpointTrafficPoliciesResponseBody(name='body'),
}

/**
 * @summary Queries the traffic policies of an endpoint that belongs to a custom routing listener.
 *
 * @param request ListCustomRoutingEndpointTrafficPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomRoutingEndpointTrafficPoliciesResponse
 */
async function listCustomRoutingEndpointTrafficPoliciesWithOptions(request: ListCustomRoutingEndpointTrafficPoliciesRequest, runtime: Util.RuntimeOptions): ListCustomRoutingEndpointTrafficPoliciesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomRoutingEndpointTrafficPolicies',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the traffic policies of an endpoint that belongs to a custom routing listener.
 *
 * @param request ListCustomRoutingEndpointTrafficPoliciesRequest
 * @return ListCustomRoutingEndpointTrafficPoliciesResponse
 */
async function listCustomRoutingEndpointTrafficPolicies(request: ListCustomRoutingEndpointTrafficPoliciesRequest): ListCustomRoutingEndpointTrafficPoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomRoutingEndpointTrafficPoliciesWithOptions(request, runtime);
}

model ListCustomRoutingEndpointsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.', example='epg-bp16jdc00bhe97sr5****'),
  listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListCustomRoutingEndpointsResponseBody = {
  endpoints?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance with which the endpoint is associated.', example='ga-bp1odcab8tmno0hdq****'),
      endpoint?: string(name='Endpoint', description='The name of the vSwitch that is specified as an endpoint.', example='vsw-test01'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint belongs.', example='epg-bp16jdc00bhe97sr5****'),
      endpointId?: string(name='EndpointId', description='The endpoint ID.', example='ep-bp14sz7ftcwwjgrdm****'),
      listenerId?: string(name='ListenerId', description='The ID of the listener to which the endpoint belongs.', example='lsr-bp1bpn0kn908w4nbw****'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the GA instance.

>  This parameter is valid only if **ServiceManaged** is set to **True**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action performed on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener
*   **IpSet**: acceleration region
*   **EndpointGroup**: endpoint group
*   **ForwardingRule**: forwarding rule
*   **Endpoint**: endpoint
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener

>  This parameter is valid only if **Action** is set to **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed resource.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed resource.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

>  This parameter is valid only if **ServiceManaged** is set to **True**.

*   Users can perform only specific actions on a managed instance.'),
      trafficToEndpointPolicy?: string(name='TrafficToEndpointPolicy', description='The access policy of traffic that is destined for the endpoint. Valid values:

*   **AllowAll**: allows all traffic to the endpoint.
*   **DenyAll**: denies all traffic to the endpoint.
*   **AllowCustom**: allows traffic only to specified destinations.', example='DenyAll'),
      type?: string(name='Type', description='The backend service type of the endpoint.

Only **PrivateSubNet** may be returned, which indicates a private CIDR block.', example='PrivateSubNet'),
    }
  ](name='Endpoints', description='The information about the endpoints.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListCustomRoutingEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomRoutingEndpointsResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of an endpoint.
 *
 * @param request ListCustomRoutingEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomRoutingEndpointsResponse
 */
async function listCustomRoutingEndpointsWithOptions(request: ListCustomRoutingEndpointsRequest, runtime: Util.RuntimeOptions): ListCustomRoutingEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomRoutingEndpoints',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configurations of an endpoint.
 *
 * @param request ListCustomRoutingEndpointsRequest
 * @return ListCustomRoutingEndpointsResponse
 */
async function listCustomRoutingEndpoints(request: ListCustomRoutingEndpointsRequest): ListCustomRoutingEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomRoutingEndpointsWithOptions(request, runtime);
}

model ListCustomRoutingPortMappingsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp16jdc00bhe97sr5****'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Maximum value: **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListCustomRoutingPortMappingsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='10'),
  portMappings?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      acceleratorPort?: int32(name='AcceleratorPort', description='The acceleration port.', example='3000'),
      destinationSocketAddress?: {
        ipAddress?: string(name='IpAddress', description='The service IP address of the backend instance.', example='10.0.XX.XX'),
        port?: int32(name='Port', description='The service port of the backend instance.', example='443'),
      }(name='DestinationSocketAddress', description='The service IP address and port of the backend instance.'),
      destinationTrafficState?: string(name='DestinationTrafficState', description='The access policy of traffic for the backend instance. Valid values:

*   **allow**: allows traffic to the backend instance.
*   **deny**: denies traffic to the backend instance.', example='allow'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region in which the endpoint group resides.', example='us-west-1'),
      endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
      listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
      protocols?: [ string ](name='Protocols', description='The protocol of the backend service.

*   **tcp**: TCP
*   **udp**: UDP'),
      vswitch?: string(name='Vswitch', description='The name of the endpoint (vSwitch).', example='vsw-test01'),
    }
  ](name='PortMappings', description='Details about the port mapping table.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListCustomRoutingPortMappingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomRoutingPortMappingsResponseBody(name='body'),
}

/**
 * @summary Queries the port mapping table of a custom routing listener.
 *
 * @description After you configure a custom routing listener for a Global Accelerator (GA) instance, the instance generates a port mapping table based on the listener port range, backend service protocols and port ranges of the associated endpoint groups, and IP addresses of endpoints (vSwitches). The custom routing listener forwards client requests to specified IP addresses and ports in the vSwitches based on the port mapping table. This operation is used to query the generated port mapping table.
 *
 * @param request ListCustomRoutingPortMappingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomRoutingPortMappingsResponse
 */
async function listCustomRoutingPortMappingsWithOptions(request: ListCustomRoutingPortMappingsRequest, runtime: Util.RuntimeOptions): ListCustomRoutingPortMappingsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomRoutingPortMappings',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the port mapping table of a custom routing listener.
 *
 * @description After you configure a custom routing listener for a Global Accelerator (GA) instance, the instance generates a port mapping table based on the listener port range, backend service protocols and port ranges of the associated endpoint groups, and IP addresses of endpoints (vSwitches). The custom routing listener forwards client requests to specified IP addresses and ports in the vSwitches based on the port mapping table. This operation is used to query the generated port mapping table.
 *
 * @param request ListCustomRoutingPortMappingsRequest
 * @return ListCustomRoutingPortMappingsResponse
 */
async function listCustomRoutingPortMappings(request: ListCustomRoutingPortMappingsRequest): ListCustomRoutingPortMappingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomRoutingPortMappingsWithOptions(request, runtime);
}

model ListCustomRoutingPortMappingsByDestinationRequest {
  destinationAddress?: string(name='DestinationAddress', description='The service IP address of the backend instance.

This parameter is required.', example='10.0.XX.XX'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint to which the backend instance belongs.

This parameter is required.', example='ep-bp16jdc00bhe97sr5****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Maximum value: **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListCustomRoutingPortMappingsByDestinationResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  portMappings?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      acceleratorPort?: int32(name='AcceleratorPort', description='The acceleration port.', example='3000'),
      destinationSocketAddress?: {
        ipAddress?: string(name='IpAddress', description='The service IP address of the backend instance.', example='10.0.XX.XX'),
        port?: int32(name='Port', description='The service port of the backend instance.', example='443'),
      }(name='DestinationSocketAddress', description='The service IP address and port of the backend instance.'),
      destinationTrafficState?: string(name='DestinationTrafficState', description='The access policy of traffic for the backend instance.

*   **allow**: allows traffic to the backend instance.
*   **deny**: denies all traffic to the backend instance.', example='allow'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp14sz7ftcwwjgrdm****'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region in which the endpoint group resides.', example='us-west-1'),
      endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
      listenerId?: string(name='ListenerId', description='The ID of the listener.', example='ga-bp1odcab8tmno0hdq****'),
      protocols?: [ string ](name='Protocols', description='The protocol of the backend service.

*   **tcp**: TCP
*   **udp**: UDP'),
      vswitch?: string(name='Vswitch', description='The name of the endpoint (vSwitch).', example='vsw-test01'),
    }
  ](name='PortMappings', description='Details about the port mapping table.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='String	04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListCustomRoutingPortMappingsByDestinationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomRoutingPortMappingsByDestinationResponseBody(name='body'),
}

/**
 * @summary Queries the port mapping table of a specified backend instance that is associated with a custom routing listener.
 *
 * @param request ListCustomRoutingPortMappingsByDestinationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomRoutingPortMappingsByDestinationResponse
 */
async function listCustomRoutingPortMappingsByDestinationWithOptions(request: ListCustomRoutingPortMappingsByDestinationRequest, runtime: Util.RuntimeOptions): ListCustomRoutingPortMappingsByDestinationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationAddress)) {
    query['DestinationAddress'] = request.destinationAddress;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomRoutingPortMappingsByDestination',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the port mapping table of a specified backend instance that is associated with a custom routing listener.
 *
 * @param request ListCustomRoutingPortMappingsByDestinationRequest
 * @return ListCustomRoutingPortMappingsByDestinationResponse
 */
async function listCustomRoutingPortMappingsByDestination(request: ListCustomRoutingPortMappingsByDestinationRequest): ListCustomRoutingPortMappingsByDestinationResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomRoutingPortMappingsByDestinationWithOptions(request, runtime);
}

model ListDomainsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance that you want to query.', example='ga-bp1odcab8tmno0hdq****'),
  domain?: string(name='Domain', description='The accelerated domain name that you want to query.', example='www.example.com'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  state?: string(name='State', description='The ICP filing status of the accelerated domain name that you want to query. Valid values:

*   **illegal:** The domain name is illegal.
*   **inactive:** The domain name has not completed ICP filing.
*   **active:** The domain name has a valid ICP filing.
*   **unknown:** The ICP filing status is unknown.', example='active'),
}

model ListDomainsResponseBody = {
  domains?: [ 
    {
      accelerators?: [ 
        {
          acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
          name?: string(name='Name', description='The name of the GA instance.', example='Accelerator'),
          serviceId?: string(name='ServiceId', description='The ID of the service that manages the GA instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.', example='ALB'),
          serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**: The GA instance is managed.
*   **false**: The GA instance is not managed.', example='true'),
          serviceManagedInfos?: [ 
            {
              action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**: Create an instance.
*   **Update**: Update the current instance.
*   **Delete**: Delete the current instance.
*   **Associate**: Reference the current instance.
*   **UserUnmanaged**: Unmanage the instance.
*   **CreateChild**: Create a child resource in the current instance.', example='Update'),
              childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if **Action** is set to **CreateChild**.', example='Listener'),
              isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and you cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and you can perform the specified actions on the managed instance.', example='false'),
            }
          ](name='ServiceManagedInfos', description='The actions that you can perform on the managed instance.

>  This parameter takes effect only if **ServiceManaged** is set to **True**.

*   You can perform only specific actions on a managed instance.'),
        }
      ](name='Accelerators', description='A list of GA instances.'),
      domain?: string(name='Domain', description='The accelerated domain name.', example='www.example.com'),
      state?: string(name='State', description='The ICP filing status of the accelerated domain name. Valid values:

*   **illegal:** The domain name is illegal.
*   **inactive:** The domain name has not completed ICP filing.
*   **active:** The domain name has a valid ICP number.
*   **unknown:** The ICP filing status is unknown.', example='active'),
    }
  ](name='Domains', description='A list of accelerated domain names.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDomainsResponseBody(name='body'),
}

/**
 * @summary Queries the information of an accelerated domain name of a GA instance.
 *
 * @param request ListDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDomainsResponse
 */
async function listDomainsWithOptions(request: ListDomainsRequest, runtime: Util.RuntimeOptions): ListDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDomains',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information of an accelerated domain name of a GA instance.
 *
 * @param request ListDomainsRequest
 * @return ListDomainsResponse
 */
async function listDomains(request: ListDomainsRequest): ListDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDomainsWithOptions(request, runtime);
}

model ListEndpointGroupIpAddressCidrBlocksRequest {
  acceleratorId?: string(name='AcceleratorId'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The region ID of the endpoint group.

This parameter is required.', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListEndpointGroupIpAddressCidrBlocksResponseBody = {
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The region ID of the endpoint group.', example='cn-hangzhou'),
  ipAddressCidrBlocks?: [ string ](name='IpAddressCidrBlocks', description='The CIDR blocks.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4B6DBBB0-2D01-4C6A-A384-4129266E6B78'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the endpoint group belongs.', example='rg-aekztkx4zwc****'),
  state?: string(name='State', description='The status of the endpoint group.', example='active'),
}

model ListEndpointGroupIpAddressCidrBlocksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEndpointGroupIpAddressCidrBlocksResponseBody(name='body'),
}

/**
 * @summary Queries the public CIDR blocks to which the endpoint group IP addresses belong. The CIDR blocks can be used to configure ACLs in terminals.
 *
 * @param request ListEndpointGroupIpAddressCidrBlocksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEndpointGroupIpAddressCidrBlocksResponse
 */
async function listEndpointGroupIpAddressCidrBlocksWithOptions(request: ListEndpointGroupIpAddressCidrBlocksRequest, runtime: Util.RuntimeOptions): ListEndpointGroupIpAddressCidrBlocksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.endpointGroupRegion)) {
    query['EndpointGroupRegion'] = request.endpointGroupRegion;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEndpointGroupIpAddressCidrBlocks',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the public CIDR blocks to which the endpoint group IP addresses belong. The CIDR blocks can be used to configure ACLs in terminals.
 *
 * @param request ListEndpointGroupIpAddressCidrBlocksRequest
 * @return ListEndpointGroupIpAddressCidrBlocksResponse
 */
async function listEndpointGroupIpAddressCidrBlocks(request: ListEndpointGroupIpAddressCidrBlocksRequest): ListEndpointGroupIpAddressCidrBlocksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEndpointGroupIpAddressCidrBlocksWithOptions(request, runtime);
}

model ListEndpointGroupsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  accessLogSwitch?: string(name='AccessLogSwitch', description='Specifies whether the access logging feature is enabled. Default value: off. Valid values:

*   **on**: The access logging feature is enabled.
*   **off**: The access logging feature is disabled.', example='on'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp16jdc00bhe97sr5****'),
  endpointGroupType?: string(name='EndpointGroupType', description='The type of the endpoint group. Valid values:

*   **default**
*   **virtual**
*   If you leave this parameter empty, all default and virtual endpoint groups are queried.', example='virtual'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the endpoint group. It cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. The tag key cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='test-key'),
      value?: string(name='Value', description='The tag value of the endpoint group. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag value cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='test-value'),
    }
  ](name='Tag', description='The tag of the endpoint group.', nullable=false),
}

model ListEndpointGroupsResponseBody = {
  endpointGroups?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      description?: string(name='Description', description='The description of the endpoint group.', example='group1'),
      endpointConfigurations?: [ 
        {
          enableClientIPPreservation?: boolean(name='EnableClientIPPreservation', description='Indicates whether the client IP address preservation feature is enabled. Valid values:

*   **true**
*   **false**', example='false'),
          endpoint?: string(name='Endpoint', description='The IP address or domain name of the endpoint.', example='47.1.XX.XX'),
          endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp1d2utp8qqe2a44t****'),
          probePort?: int32(name='ProbePort', description='The port that is used to monitor latency.', example='80'),
          probeProtocol?: string(name='ProbeProtocol', description='The protocol that is used to monitor latency.

*   **icmp**
*   **tcp**', example='tcp'),
          subAddress?: string(name='SubAddress', description='The private IP address of the ENI.', example='172.168.XX.XX'),
          type?: string(name='Type', description='The type of the endpoint. Valid values:

*   **Domain:** a custom domain name.
*   **Ip:** a custom IP address.
*   **PublicIp:** a public IP address provided by Alibaba Cloud.
*   **ECS:** an Elastic Compute Service (ECS) instance.
*   **SLB:** a Classic Load Balancer (SLB) instance.
*   **ALB:** an Application Load Balancer (ALB) instance.
*   **OSS:** an Object Storage Service (OSS) bucket.
*   **ENI:** an elastic network interface (ENI).
*   **NLB:** a Network Load Balancer (NLB) instance.', example='Ip'),
          weight?: int32(name='Weight', description='The weight of the endpoint.', example='20'),
        }
      ](name='EndpointConfigurations', description='The configurations of endpoints in the endpoint group.'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.', example='epg-bp16jdc00bhe97sr5****'),
      endpointGroupIpList?: [ string ](name='EndpointGroupIpList', description='The endpoint group IP addresses.'),
      endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region where the endpoint group is created.', example='cn-hangzhou'),
      endpointGroupType?: string(name='EndpointGroupType', description='The type of the endpoint group. Valid values:

*   **default**: a default endpoint group
*   **virtual:** a virtual endpoint group.', example='default'),
      endpointGroupUnconfirmedIpList?: [ string ](name='EndpointGroupUnconfirmedIpList', description='The endpoint group IP addresses to be confirmed after the GA instance is upgraded.'),
      endpointProtocolVersion?: string(name='EndpointProtocolVersion', description='The protocol version that is used by the backend server.

*   **HTTP1.1**
*   **HTTP2**'),
      endpointRequestProtocol?: string(name='EndpointRequestProtocol', description='The protocol that is used by the backend server.

*   **HTTP**
*   **HTTPS**', example='HTTP'),
      forwardingRuleIds?: [ string ](name='ForwardingRuleIds', description='The IDs of the forwarding rules that are associated with the endpoint group.'),
      healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Indicates whether the health check feature is enabled.

*   **true**
*   **false**', example='true'),
      healthCheckIntervalSeconds?: int32(name='HealthCheckIntervalSeconds', description='The interval at which you want to perform health checks. Unit: seconds.', example='3'),
      healthCheckPath?: string(name='HealthCheckPath', description='The path that is used for health checks.', example='/healthcheck'),
      healthCheckPort?: int32(name='HealthCheckPort', description='The port that is used for health checks.', example='10'),
      healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol over which health check requests are sent. Valid values:

*   **tcp** or **TCP**
*   **http** or **HTTP**
*   **https** or **HTTPS**', example='tcp'),
      listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
      name?: string(name='Name', description='The name of the endpoint group.', example='group1'),
      portOverrides?: [ 
        {
          endpointPort?: int32(name='EndpointPort', description='The endpoint port.', example='80'),
          listenerPort?: int32(name='ListenerPort', description='The listener port.', example='443'),
        }
      ](name='PortOverrides', description='The port mapping.'),
      serviceId?: string(name='ServiceId', description='The service that manages the instance.

>  This parameter takes effect only if the value of **Service managed** is **true**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the GA instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action that was performed on the managed instance. Valid values:

*   **Create:** Create an instance.
*   **Update:** Update the current instance.
*   **Delete:** Delete the current instance.
*   **Associate:** Reference the current instance.
*   **UserUnmanaged:** Unmanage the instance.
*   **CreateChild:** Create a child resource in the current instance.', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener:** listener.
*   **IpSet:** acceleration region.
*   **EndpointGroup:** endpoint group.
*   **ForwardingRule:** forwarding rule.
*   **Endpoint:** endpoint.
*   **EndpointGroupDestination:** the protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy:** the traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if you set **Action** to **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed. Valid values:

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

> 

*   This parameter takes effect only if the value of **ServiceManaged** is **true**.

*   Users can perform only specific actions on a managed instance.'),
      state?: string(name='State', description='The status of the endpoint group. Valid values:

*   **init:** The endpoint group is being initialized.
*   **active:** The endpoint group is running normally.
*   **updating:**The endpoint group is being updated.
*   **deleteing:** The endpoint group is being deleted.', example='active'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the endpoint group.', example='test-key'),
          value?: string(name='Value', description='The tag value of the endpoint group.', example='test-value'),
        }
      ](name='Tags', description='The tag of the endpoint group.'),
      thresholdCount?: int32(name='ThresholdCount', description='The number of consecutive failed health checks that must occur before an endpoint is considered unhealthy.', example='3'),
      trafficPercentage?: int32(name='TrafficPercentage', description='The value of the traffic distribution ratio. If a listener is associated with multiple endpoint groups, you can set this parameter to distribute different percentages of traffic to the endpoint groups.', example='20'),
    }
  ](name='EndpointGroups', description='The configurations of the endpoint group.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A052D49E-CCC2-41DB-816C-DC3381503194'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Queries a list of endpoint groups.
 *
 * @param request ListEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEndpointGroupsResponse
 */
async function listEndpointGroupsWithOptions(request: ListEndpointGroupsRequest, runtime: Util.RuntimeOptions): ListEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.accessLogSwitch)) {
    query['AccessLogSwitch'] = request.accessLogSwitch;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointGroupType)) {
    query['EndpointGroupType'] = request.endpointGroupType;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of endpoint groups.
 *
 * @param request ListEndpointGroupsRequest
 * @return ListEndpointGroupsResponse
 */
async function listEndpointGroups(request: ListEndpointGroupsRequest): ListEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEndpointGroupsWithOptions(request, runtime);
}

model ListForwardingRulesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qzk****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among all requests. The ClientToken value contain only ASCII characters.

>  If you do not set this parameter, the system sets **ClientToken** to the value of **RequestId**. The value of **RequestId** may be different for each API request.', example='02fb3da4****'),
  forwardingRuleId?: string(name='ForwardingRuleId', description='The ID of the forwarding rule.', example='frule-bp19a3t3yzr21q3****'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1s0vzbi5bxlx5pw****'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If this is your first query or no subsequent query is to be sent, ignore this parameter.
*   If a next query is to be sent, set the value to the value of **NextToken** that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListForwardingRulesResponseBody = {
  forwardingRules?: [ 
    {
      forwardingRuleDirection?: string(name='ForwardingRuleDirection', description='The direction in which the forwarding rule takes effect.

By default, **request** is returned, which indicates that the forwarding rule takes effect on requests.', example='request'),
      forwardingRuleId?: string(name='ForwardingRuleId', description='The forwarding rule ID.', example='frule-bp19a3t3yzr21q3****'),
      forwardingRuleName?: string(name='ForwardingRuleName', description='The forwarding rule name.', example='auto_named_rule'),
      forwardingRuleStatus?: string(name='ForwardingRuleStatus', description='The state of the forwarding rule. Valid values:

*   **active:** The forwarding rule is normal.
*   **configuring:** The forwarding rule is being modified.
*   **deleting:** The forwarding rule is being deleted.', example='active'),
      listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1s0vzbi5bxlx5****'),
      priority?: int32(name='Priority', description='The priority of the forwarding rule.

A value between **1** and **10000** is returned. A smaller value indicates a higher priority.', example='1000'),
      ruleActions?: [ 
        {
          forwardGroupConfig?: {
            serverGroupTuples?: [ 
              {
                endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.', example='epg-bp1enpdcrqhl78g6r****'),
              }
            ](name='ServerGroupTuples', description='The information about the endpoint groups.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.'),
          }(name='ForwardGroupConfig', description='The forwarding action configuration.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.'),
          order?: int32(name='Order', description='The forwarding priority.

>  This parameter does not take effect.', example='1'),
          ruleActionType?: string(name='RuleActionType', description='The type of the forwarding action. Valid values:

*   **ForwardGroup:** forwards a request.
*   **Redirect:** redirects a request.
*   **FixResponse:** returns a fixed response.
*   **Rewrite:** rewrites a request.
*   **AddHeader:** adds a header to a request.
*   **RemoveHeaderConfig:** deletes the header of a request.', example='ForwardGroup'),
          ruleActionValue?: string(name='RuleActionValue', description='The value of the forwarding action type.

Different JSON strings are returned based on the value of the **RuleActionType** parameter.

*   If you set **RuleActionType** to **ForwardGroup**, the information about a virtual endpoint group is returned. Parameter configuration:

    *   `type:` the type of the resource that is returned. The value is `endpointgroup`.
    *   `value:` the ID of the virtual endpoint group that is returned.

*   If you set **RuleActionType** to **Redirect**, the redirecting configuration is returned. Parameter configuration:

    *   `protocol:` the protocol of requests after the requests are redirected.
    *   `domain:` the domain name to which requests are redirected.
    *   `port:` the port to which requests are redirected.
    *   `path:` the path to which requests are redirected.
    *   `query:` the query string of the requests that are redirected.
    *   `code:` the redirecting code.

*   If you set **RuleActionType** to **FixResponse**, the information about the fixed response that you configured is returned. Parameter configuration:

    *   `code:` the HTTP status code that is returned.
    *   `type:` the type of the response content that is returned.
    *   `content:` the response content that is returned.

*   If **RuleActionType** is set to **AddHeader**, the information about the HTTP header that is added is returned. Parameter configuration:

    *   `name:` the name of the HTTP header that is returned.
    *   `type:` the content type of the HTTP header that is returned.
    *   `value:` the content of the HTTP header that is returned.

*   If you set **RuleActionType** to **RemoveHeader**, the information about the HTTP header that is deleted is returned.

*   If you set **RuleActionType** to **Rewrite**, the rewriting configuration is returned. Parameter configuration:

    *   `domain:` the domain name to which requests are redirected.
    *   `path:` the path to which requests are redirected.
    *   `query:` the query string of the requests that are redirected.', example='[{"type":"endpointgroup", "value":"epg-bp1enpdcrqhl78g6r****"}]'),
        }
      ](name='RuleActions', description='The forwarding actions.'),
      ruleConditions?: [ 
        {
          hostConfig?: {
            values?: [ string ](name='Values', description='The domain name configuration.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.'),
          }(name='HostConfig', description='The domain name configuration.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.'),
          pathConfig?: {
            values?: [ string ](name='Values', description='The path configuration.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.'),
          }(name='PathConfig', description='The path configuration.

>  GA instances created after July 12, 2022 support all forwarding condition types and action types. We recommend that you query forwarding conditions and actions by calling the **RuleActionType** and **RuleActionValue** operations.'),
          ruleConditionType?: string(name='RuleConditionType', description='The type of the forwarding condition. Valid values:

*   **Host:** domain name.
*   **Path:** path.
*   **RequestHeader:** HTTP header.
*   **Query:** query string.
*   **Method:** HTTP method.
*   **Cookie:** cookie.
*   **SourceIP:** source IP address.', example='Host'),
          ruleConditionValue?: string(name='RuleConditionValue', description='The value of the forwarding condition type.

Different JSON strings are returned based on the value of the **RuleConditionType** parameter.

*   If you set **RuleConditionType** to **Host**, a domain name condition is returned. If multiple domain names are returned in a forwarding condition, the relationship between the domain names is OR.
*   If you set **RuleConditionType** to **Path**, a path condition is returned. If multiple forwarding conditions of the path type are returned in a forwarding rule, the relationship between the forwarding conditions is OR. If multiple paths are returned in a forwarding condition, the relationship between the paths is OR.
*   If you set **RuleConditionType** to **RequestHeader**, an HTTP header condition that consists of key-value pairs is returned.
*   If you set **RuleConditionType** to **Query**, a query string condition that consists of key-value pairs is returned.
*   If you set **RuleConditionType** to **Method**, an HTTP method condition is returned.
*   If you set **RuleConditionType** to **Cookie**, a cookie condition that consists of key-value pairs is returned.
*   If you set **RuleConditionType** to **SourceIP**, a source IP address condition is returned. If multiple source IP addresses are returned in a forwarding condition, the relationship between the source IP addresses is OR.', example='["www.example.com", "www.aliyun.com"]'),
        }
      ](name='RuleConditions', description='The conditions that trigger the forwarding rule.'),
      serviceId?: string(name='ServiceId', description='The service ID to which the managed instance belongs.

>  Valid only when the ServiceManaged parameter is True.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Is it a managed instance. Valid values:

- true
- false', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='Managed policy action name, Valid values:
- Create
- Update
- Delete
- Associate
- UserUnmanaged
- CreateChild', example='Update'),
          childType?: string(name='ChildType', description='Sub resource type, Valid values:

- Listener
- IpSet
- EndpointGroup
- ForwardingRule
- Endpoint
- EndpointGroupDestination
- EndpointPolicy

>Only valid when the Action parameter is CreateChild.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Is the managed policy action managed, Valid values:

- true: The managed policy action is managed, and users do not have permission to perform the operation specified in the Action on the managed instance.

- false: The managed policy action is not managed, and users have permission to perform the operation specified in the Action on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='A list of action policies that users can execute on this managed instance.'),
    }
  ](name='ForwardingRules', description='The forwarding rules.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If **NextToken** is not returned, it indicates that no additional results exist.
*   If **NextToken** is returned, the value indicates the token that is used for the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CFC67ED9-4AB1-431F-B6E3-A752B7B8CCD4'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListForwardingRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListForwardingRulesResponseBody(name='body'),
}

/**
 * @summary Queries the information about existing forwarding rules.
 *
 * @description >  This operation is used to query only custom forwarding rules, not the default forwarding rule.
 *
 * @param request ListForwardingRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListForwardingRulesResponse
 */
async function listForwardingRulesWithOptions(request: ListForwardingRulesRequest, runtime: Util.RuntimeOptions): ListForwardingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forwardingRuleId)) {
    query['ForwardingRuleId'] = request.forwardingRuleId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListForwardingRules',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about existing forwarding rules.
 *
 * @description >  This operation is used to query only custom forwarding rules, not the default forwarding rule.
 *
 * @param request ListForwardingRulesRequest
 * @return ListForwardingRulesResponse
 */
async function listForwardingRules(request: ListForwardingRulesRequest): ListForwardingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listForwardingRulesWithOptions(request, runtime);
}

model ListIpSetsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1yeeq8yfoyszmqy****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **100**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListIpSetsResponseBody = {
  ipSets?: [ 
    {
      accelerateRegionId?: string(name='AccelerateRegionId', description='The ID of the acceleration region.', example='cn-hangzhou'),
      bandwidth?: int32(name='Bandwidth', description='The bandwidth that is allocated to the acceleration region. Unit: **Mbit/s**.', example='2'),
      ipAddressList?: [ string ](name='IpAddressList', description='The accelerated IP addresses.'),
      ipSetId?: string(name='IpSetId', description='The ID of the acceleration region.', example='ips-bp11r5jb8ogp122xl****'),
      ipVersion?: string(name='IpVersion', description='The IP version. Valid values:

*   **IPv4**
*   **IPv6**
*   **DUAL_STACK**', example='IPv4'),
      ispType?: string(name='IspType', description='The line type of the elastic IP address (EIP) in the acceleration region. Valid values:

*   **BGP**: BGP (Multi-ISP) lines. This is the default value.
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines.', example='BGP'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter takes effect only if **ServiceManaged** is set to **true**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if **Action** is set to **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true**: The specified actions are managed, and users cannot perform the actions on the managed instance.****
*   **false**: The specified actions are not managed, and users can perform the actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.

> *   This parameter takes effect only if **ServiceManaged** is set to **true**.
>*   Users can perform only specific actions on a managed instance.'),
      state?: string(name='State', description='The status of the acceleration region. Valid values:

*   **init:** The acceleration region is being initialized.
*   **active:** The acceleration region is in the running state.
*   **updating:** The acceleration region is being configured.
*   **deleting:** The acceleration region is being deleted.', example='active'),
    }
  ](name='IpSets', description='The acceleration regions.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A9B4E54C-9CCD-4002-91A9-D38C6C209192'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model ListIpSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpSetsResponseBody(name='body'),
}

/**
 * @summary Queries acceleration regions.
 *
 * @param request ListIpSetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpSetsResponse
 */
async function listIpSetsWithOptions(request: ListIpSetsRequest, runtime: Util.RuntimeOptions): ListIpSetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpSets',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries acceleration regions.
 *
 * @param request ListIpSetsRequest
 * @return ListIpSetsResponse
 */
async function listIpSets(request: ListIpSetsRequest): ListIpSetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpSetsWithOptions(request, runtime);
}

model ListIspTypesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance that you want to query.', example='ga-bp1odcab8tmno0hdq****'),
  acceleratorType?: string(name='AcceleratorType', description='The type of the Global Accelerator (GA) instance to be queried. Valid values:

*   **basic**: basic GA instance
*   **standard**: standard GA instance', example='basic'),
  businessRegionId?: string(name='BusinessRegionId', description='The ID of the acceleration region to be queried.

This parameter is required.', example='cn-hangzhou'),
}

model ListIspTypesResponseBody = {
  ispTypeList?: [ string ](name='IspTypeList', description='The line types of EIPs in the acceleration region.

*   **BGP** (default): BGP (Multi-ISP) lines
*   **BGP_PRO**: BGP (Multi-ISP) Pro lines

If you have the permissions to use single-ISP bandwidth, one of the following values may be returned:

*   **ChinaTelecom**: China Telecom (single ISP)
*   **ChinaUnicom**: China Unicom (single ISP)
*   **ChinaMobile**: China Mobile (single ISP)
*   **ChinaTelecom_L2**: China Telecom_L2 (single ISP)
*   **ChinaUnicom_L2**: China Unicom_L2 (single ISP)
*   **ChinaMobile_L2**: China Mobile_L2 (single ISP)

> Different acceleration regions support different single-ISP BGP lines.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model ListIspTypesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIspTypesResponseBody(name='body'),
}

/**
 * @summary Queries the line types of elastic IP addresses (EIPs) that are supported in an acceleration region.
 *
 * @param request ListIspTypesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIspTypesResponse
 */
async function listIspTypesWithOptions(request: ListIspTypesRequest, runtime: Util.RuntimeOptions): ListIspTypesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.acceleratorType)) {
    query['AcceleratorType'] = request.acceleratorType;
  }
  if (!Util.isUnset(request.businessRegionId)) {
    query['BusinessRegionId'] = request.businessRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIspTypes',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the line types of elastic IP addresses (EIPs) that are supported in an acceleration region.
 *
 * @param request ListIspTypesRequest
 * @return ListIspTypesResponse
 */
async function listIspTypes(request: ListIspTypesRequest): ListIspTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIspTypesWithOptions(request, runtime);
}

model ListListenerCertificatesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return. Valid values: **1** to **50**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of NextToken.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  role?: string(name='Role', description='The type of the certificate. Valid values:

*   **default**
*   **additional**

If you do not specify this parameter, default and additional certificates are returned by default.', example='default', nullable=true),
}

model ListListenerCertificatesResponseBody = {
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The certificate ID.', example='6092**-cn-hangzhou'),
      domain?: string(name='Domain', description='The domain name associated with the additional certificate.

This parameter is not returned if the certificate is a default one.', example='example.com'),
      isDefault?: boolean(name='IsDefault', description='Indicates whether the certificate is a default one.

*   **true**
*   **false**', example='true'),
      state?: string(name='State', description='The status of the certificate.

*   **active**: The certificate is associated with a listener and in effect.
*   **updating**: The additional certificate is being replaced.', example='active'),
    }
  ](name='Certificates', description='The certificates.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value of **NextToken** is returned, the value indicates the token that is used for the next query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListListenerCertificatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListListenerCertificatesResponseBody(name='body'),
}

/**
 * @summary Queries the certificates associated with a listener.
 *
 * @param request ListListenerCertificatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListListenerCertificatesResponse
 */
async function listListenerCertificatesWithOptions(request: ListListenerCertificatesRequest, runtime: Util.RuntimeOptions): ListListenerCertificatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.role)) {
    query['Role'] = request.role;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListListenerCertificates',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the certificates associated with a listener.
 *
 * @param request ListListenerCertificatesRequest
 * @return ListListenerCertificatesResponse
 */
async function listListenerCertificates(request: ListListenerCertificatesRequest): ListListenerCertificatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listListenerCertificatesWithOptions(request, runtime);
}

model ListListenersRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to **50**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListListenersResponseBody = {
  listeners?: [ 
    {
      acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp1odcab8tmno0hdq****'),
      backendPorts?: [ 
        {
          fromPort?: string(name='FromPort', description='The first port in the range of ports that are used by backend servers.', example='80'),
          toPort?: string(name='ToPort', description='The last port in the range of ports that are used by backend servers.', example='80'),
        }
      ](name='BackendPorts', description='The range of ports that are used by backend servers.'),
      certificates?: [ 
        {
          id?: string(name='Id', description='The ID of the SSL certificate.', example='44983xxxx-cn-hangzhou'),
          type?: string(name='Type', description='The type of the SSL certificate.

Only **Server** may be returned, which indicates a server certificate.', example='Server'),
        }
      ](name='Certificates', description='The information about the SSL certificates.'),
      clientAffinity?: string(name='ClientAffinity', description='Indicates whether client affinity is enabled for the listener.

*   If **NONE** is returned, client affinity is disabled. When client affinity is disabled, requests from the same client may be forwarded to different endpoints.
*   If **SOURCE_IP** is returned, client affinity is enabled. When a client accesses stateful applications, requests from the same client are forwarded to the same endpoint regardless of the source port or protocol.', example='SOURCE_IP'),
      createTime?: long(name='CreateTime', description='The timestamp that indicates when the listener was created. Unit: milliseconds.', example='1577786252000'),
      description?: string(name='Description', description='The description of the listener.', example='Listener'),
      httpVersion?: string(name='HttpVersion', description='The maximum version of the HTTP protocol. Valid values:

*   **http3**
*   **http2**
*   **http1.1**

>  This parameter is returned only for HTTPS listeners.', example='http2'),
      idleTimeout?: int32(name='IdleTimeout', description='The timeout period of idle connections. Unit: seconds.', example='900'),
      listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
      name?: string(name='Name', description='The name of the listener.', example='Listener'),
      portRanges?: [ 
        {
          fromPort?: int32(name='FromPort', description='The first port in the listener port range that is used to receive and forward requests to endpoints.', example='20'),
          toPort?: int32(name='ToPort', description='The last port in the listener port range that is used to receive and forward requests to endpoints.', example='20'),
        }
      ](name='PortRanges', description='The information about the listener ports.'),
      protocol?: string(name='Protocol', description='The network transmission protocol that is used by the listener. Valid values:

*   **tcp**
*   **udp**
*   **http**
*   **https**', example='tcp'),
      proxyProtocol?: boolean(name='ProxyProtocol', description='Indicates whether client IP address preservation is enabled. Valid values:

*   **true**: Client IP address preservation is enabled. This feature allows you to view client IP addresses on backend servers.
*   **false**: Client IP address preservation is disabled.', example='true'),
      requestTimeout?: int32(name='RequestTimeout', description='The timeout period of HTTP or HTTPS requests. Unit: seconds.

>  This parameter is returned only for HTTP and HTTPS listeners. If no responses are received from the backend server within the timeout period, GA returns an HTTP 504 error code to the client.', example='60'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.

*   **tls_cipher_policy_1_0**

    *   Supported Transport Layer Security (TLS) versions: TLS 1.0, TLS 1.1, and TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_1**

    *   Supported TLS versions: TLS 1.1 and TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_2**

    *   Supported TLS version: TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

*   **tls_cipher_policy_1_2_strict**

    *   Supported TLS version: TLS 1.2.
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.

*   **tls_cipher_policy_1_2_strict_with_1_3**

    *   Supported TLS versions: TLS 1.2 and TLS 1.3.
    *   Supported cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-ECDSA-AES128-SHA, ECDHE-ECDSA-AES256-SHA, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.

>  This parameter is returned only for HTTPS listeners.', example='tls_cipher_policy_1_0'),
      serviceId?: string(name='ServiceId', description='The ID of the service that manages the instance.

>  This parameter is returned only if the value of **ServiceManaged** is **true**.', example='ALB'),
      serviceManaged?: boolean(name='ServiceManaged', description='Indicates whether the instance is managed. Valid values:

*   **true**
*   **false**', example='true'),
      serviceManagedInfos?: [ 
        {
          action?: string(name='Action', description='The name of the action on the managed instance. Valid values:

*   **Create**
*   **Update**
*   **Delete**
*   **Associate**
*   **UserUnmanaged**
*   **CreateChild**', example='Update'),
          childType?: string(name='ChildType', description='The type of the child resource. Valid values:

*   **Listener**: listener.
*   **IpSet**: acceleration region.
*   **EndpointGroup**: endpoint group.
*   **ForwardingRule**: forwarding rule.
*   **Endpoint**: endpoint.
*   **EndpointGroupDestination**: protocol mapping of an endpoint group associated with a custom routing listener.
*   **EndpointPolicy**: traffic policy of an endpoint associated with a custom routing listener.

>  This parameter takes effect only if the value of **Action** is **CreateChild**.', example='Listener'),
          isManaged?: boolean(name='IsManaged', description='Indicates whether the specified actions are managed.

*   **true**: The specified actions are managed, and users cannot perform the specified actions on the managed instance.
*   **false**: The specified actions are not managed, and users can perform the specified actions on the managed instance.', example='false'),
        }
      ](name='ServiceManagedInfos', description='The actions that users can perform on the managed instance.
> *   This parameter is returned only if the value of **ServiceManaged** is **true**.
> *   Users can perform only specific actions on a managed instance.'),
      state?: string(name='State', description='The status of the listener. Valid values:

*   **active**
*   **init**
*   **updating**
*   **deleting**', example='active'),
      type?: string(name='Type', description='The routing type of the listener. Valid values:

*   **Standard**: intelligent routing.
*   **CustomRouting**: custom routing.', example='Standard'),
      XForwardedForConfig?: {
        XForwardedForGaApEnabled?: boolean(name='XForwardedForGaApEnabled', description='Indicates whether the `GA-AP` header is used to retrieve the information about acceleration regions. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
        XForwardedForGaIdEnabled?: boolean(name='XForwardedForGaIdEnabled', description='Indicates whether the `GA-ID` header is used to retrieve the ID of the GA instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
        XForwardedForPortEnabled?: boolean(name='XForwardedForPortEnabled', description='Indicates whether the `GA-X-Forward-Port` header is used to retrieve the listener ports of the GA instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
        XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Indicates whether the `GA-X-Forward-Proto` header is used to retrieve the listener protocol of the GA instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
        XRealIpEnabled?: boolean(name='XRealIpEnabled', description='Indicates whether the `X-Real-IP` header is used to retrieve client IP addresses. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
      }(name='XForwardedForConfig', description='The configurations of the `XForward` headers.'),
    }
  ](name='Listeners', description='The information about the listeners.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListListenersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListListenersResponseBody(name='body'),
}

/**
 * @summary Queries the listeners of a Global Accelerator (GA) instance.
 *
 * @description This operation is used to query information about the listeners of a GA instance, including the status of each listener, the timestamp that indicates when each listener was created, and the listener ports.
 *
 * @param request ListListenersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListListenersResponse
 */
async function listListenersWithOptions(request: ListListenersRequest, runtime: Util.RuntimeOptions): ListListenersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListListeners',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the listeners of a Global Accelerator (GA) instance.
 *
 * @description This operation is used to query information about the listeners of a GA instance, including the status of each listener, the timestamp that indicates when each listener was created, and the listener ports.
 *
 * @param request ListListenersRequest
 * @return ListListenersResponse
 */
async function listListeners(request: ListListenersRequest): ListListenersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listListenersWithOptions(request, runtime);
}

model ListSpareIpsRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model ListSpareIpsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
  spareIps?: [ 
    {
      spareIp?: string(name='SpareIp', description='The secondary IP address that is associated with the CNAME. If the acceleration area becomes unavailable, GA redirects traffic to the secondary IP address.', example='47.100.XX.XX'),
      state?: string(name='State', description='The status of the secondary IP address. Valid values:

*   **active:** The secondary IP address is available.
*   **inuse:** The secondary IP address is in use.', example='active'),
    }
  ](name='SpareIps', description='The secondary IP addresses that are associated with the CNAME.'),
}

model ListSpareIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSpareIpsResponseBody(name='body'),
}

/**
 * @summary Queries the information about the secondary IP addresses that are associated with a CNAME.
 *
 * @param request ListSpareIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSpareIpsResponse
 */
async function listSpareIpsWithOptions(request: ListSpareIpsRequest, runtime: Util.RuntimeOptions): ListSpareIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSpareIps',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the secondary IP addresses that are associated with a CNAME.
 *
 * @param request ListSpareIpsRequest
 * @return ListSpareIpsResponse
 */
async function listSpareIps(request: ListSpareIpsRequest): ListSpareIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSpareIpsWithOptions(request, runtime);
}

model ListSystemSecurityPoliciesRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 100**. Default value: **10**.', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model ListSystemSecurityPoliciesResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='A9B4E54C-9CCD-4002-91A9-D38C6C209192'),
  securityPolicies?: [ 
    {
      ciphers?: [ string ](name='Ciphers', description='The supported cipher suites. The value of this parameter is determined by the value of **TLSVersions**.

The specified cipher suites must be supported by at least one value of **TLSVersions**. For example, if you set TLSVersions to **TLSv1.3**, you must specify cipher suites that are supported by **TLSv1.3**.

*   Valid values when TLSVersions is set to **TLSv1.0** or **TLSv1.1**:

    *   ECDHE-ECDSA-AES128-SHA
    *   ECDHE-ECDSA-AES256-SHA
    *   ECDHE-RSA-AES128-SHA
    *   ECDHE-RSA-AES256-SHA
    *   AES128-SHA
    *   AES256-SHA
    *   DES-CBC3-SHA

*   Valid values when TLSVersions is set to **TLSv1.2**:

    *   ECDHE-ECDSA-AES128-SHA
    *   ECDHE-ECDSA-AES256-SHA
    *   ECDHE-RSA-AES128-SHA
    *   ECDHE-RSA-AES256-SHA
    *   AES128-SHA
    *   AES256-SHA
    *   DES-CBC3-SHA
    *   ECDHE-ECDSA-AES128-GCM-SHA256
    *   ECDHE-ECDSA-AES256-GCM-SHA384
    *   ECDHE-ECDSA-AES128-SHA256
    *   ECDHE-ECDSA-AES256-SHA384
    *   ECDHE-RSA-AES128-GCM-SHA256
    *   ECDHE-RSA-AES256-GCM-SHA384
    *   ECDHE-RSA-AES128-SHA256
    *   ECDHE-RSA-AES256-SHA384
    *   AES128-GCM-SHA256
    *   AES256-GCM-SHA384
    *   AES128-SHA256
    *   AES256-SHA256

*   Valid values when TLSVersions is set to **TLSv1.3**:

    *   TLS_AES_128_GCM_SHA256
    *   TLS_AES_256_GCM_SHA384
    *   TLS_CHACHA20_POLY1305_SHA256
    *   TLS_AES_128_CCM_SHA256
    *   TLS_AES_128_CCM_8_SHA256'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.', example='tls_cipher_policy_1_1'),
      tlsVersions?: [ string ](name='TlsVersions', description='The supported TLS versions. Valid values: **TLSv1.0**, **TLSv1.1**, **TLSv1.2**, and **TLSv1.3**.'),
    }
  ](name='SecurityPolicies', description='The list of TLS security policies.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model ListSystemSecurityPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSystemSecurityPoliciesResponseBody(name='body'),
}

/**
 * @summary Queries the TLS security policies that are supported by HTTPS listeners.
 *
 * @description You can select a TLS security policy when you create an HTTPS listener. This API operation is used to query the TLS security policies that are supported by HTTPS listeners.
 *
 * @param request ListSystemSecurityPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSystemSecurityPoliciesResponse
 */
async function listSystemSecurityPoliciesWithOptions(request: ListSystemSecurityPoliciesRequest, runtime: Util.RuntimeOptions): ListSystemSecurityPoliciesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSystemSecurityPolicies',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the TLS security policies that are supported by HTTPS listeners.
 *
 * @description You can select a TLS security policy when you create an HTTPS listener. This API operation is used to query the TLS security policies that are supported by HTTPS listeners.
 *
 * @param request ListSystemSecurityPoliciesRequest
 * @return ListSystemSecurityPoliciesResponse
 */
async function listSystemSecurityPolicies(request: ListSystemSecurityPoliciesRequest): ListSystemSecurityPoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSystemSecurityPoliciesWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the next query. Valid values:

*   If this is your first query and no next queries are to be sent, ignore this parameter.
*   If a subsequent query is to be sent, set the parameter to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the resources whose tag information you want to query.

*   If you set **ResourceType** to **accelerator**, set the value of ResourceId to the ID of a standard GA instance.
*   If you set **ResourceType** to **basicaccelerator**, set the value of ResourceId to the ID of a basic GA instance.
*   If you set **ResourceType** to **bandwidthpackage**, set the value of ResourceId to the ID of a bandwidth plan.
*   If you set **ResourceType** to **acl**, set the value of ResourceId to the ID of an ACL.
*   If you set **ResourceType** to **endpointgroup**, set the value of ResourceId to the ID of an endpoint group.

You can specify up to 50 GA resource IDs.'),
  resourceType?: string(name='ResourceType', description='The type of the resource whose tag information you want to query. Valid values:

*   **accelerator**: a standard GA instance
*   **basicaccelerator**: a basic GA instance
*   **bandwidthpackage**: a bandwidth plan
*   **acl**: an access control list (ACL).
*   **endpointgroup**: an endpoint group

This parameter is required.', example='accelerator'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the GA resource. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='KeyTest'),
      value?: string(name='Value', description='The tag value of the GA resource. The tag value can be an empty string.

The tag value can be up to 128 characters in length and and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='valueTest'),
    }
  ](name='Tag', description='An array of tags of GA resources.

You can specify up to 20 tags.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The token that determines the start point of the next query. Valid values:

*   If **NextToken** is empty, it indicates that no subsequent query is to be sent.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='ga-bp149u6o36qt1as9b****'),
      resourceType?: string(name='ResourceType', description='The type of the resource.

*   **accelerator**: a standard GA instance
*   **basicaccelerator**: a basic GA instance
*   **bandwidthpackage**: a bandwidth plan
*   **acl**: an ACL
*   **endpointgroup**: an endpoint group', example='accelerator'),
      tagKey?: string(name='TagKey', description='The tag key.', example='valueTest'),
      tagValue?: string(name='TagValue', description='The tag value.', example='KeyTest'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The information about the resources to which tags are added.'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='1'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags that are added to Global Accelerator (GA) resources.
 *
 * @description *   You must specify **ResourceId** or **Tag** in the request to specify the object that you want to query.********
 * *   **Tag** is a resource tag that consists of a key-value pair (Key and Value). If you specify only **Key**, all tag values that are associated with the specified tag key are returned. If you specify only **Value**, an error message is returned.
 * *   If you specify **Tag** and **ResourceId** to filter tags, **ResourceId** must match all specified key-value pairs.
 * *   If you specify multiple key-value pairs, resources that contain the key-value pairs are returned.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tags that are added to Global Accelerator (GA) resources.
 *
 * @description *   You must specify **ResourceId** or **Tag** in the request to specify the object that you want to query.********
 * *   **Tag** is a resource tag that consists of a key-value pair (Key and Value). If you specify only **Key**, all tag values that are associated with the specified tag key are returned. If you specify only **Value**, an error message is returned.
 * *   If you specify **Tag** and **ResourceId** to filter tags, **ResourceId** must match all specified key-value pairs.
 * *   If you specify multiple key-value pairs, resources that contain the key-value pairs are returned.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model OpenAcceleratorServiceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model OpenAcceleratorServiceResponseBody = {
  code?: string(name='Code', description='The response code.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  orderId?: long(name='OrderId', description='The ID of the order.', example='208257****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B49B60F6-F6C8-49E5-B06B-E33E3A469A92'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true:** The call was successful.
*   **false:** The call failed.', example='True'),
}

model OpenAcceleratorServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenAcceleratorServiceResponseBody(name='body'),
}

/**
 * @summary Activates the pay-as-you-go Global Accelerator (GA) service. If you want to use pay-as-you-go GA instances, you must activate the pay-as-you-go GA service first.
 *
 * @param request OpenAcceleratorServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenAcceleratorServiceResponse
 */
async function openAcceleratorServiceWithOptions(request: OpenAcceleratorServiceRequest, runtime: Util.RuntimeOptions): OpenAcceleratorServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenAcceleratorService',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Activates the pay-as-you-go Global Accelerator (GA) service. If you want to use pay-as-you-go GA instances, you must activate the pay-as-you-go GA service first.
 *
 * @param request OpenAcceleratorServiceRequest
 * @return OpenAcceleratorServiceResponse
 */
async function openAcceleratorService(request: OpenAcceleratorServiceRequest): OpenAcceleratorServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openAcceleratorServiceWithOptions(request, runtime);
}

model QueryCrossBorderApprovalStatusRequest {
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model QueryCrossBorderApprovalStatusResponseBody = {
  approvalStatus?: string(name='ApprovalStatus', description='Cross border permissions of Alibaba Cloud account (main account).

-  UNAPPLIED : No cross-border permission application has been submitted or application records cannot be found.
-  APPLIED : Cross-border permission review in progress.
-  REJECTED : Cross-border permission review failed.
-  PASSED : Cross-border permission review passed.', example='UNAPPLIED'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F96E634B-A523-587F-9A09-AE8B2FD04B9C'),
}

model QueryCrossBorderApprovalStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCrossBorderApprovalStatusResponseBody(name='body'),
}

/**
 * @summary Inquire about the approval status of cross-border permissions for an Alibaba Cloud account (main account).
 *
 * @param request QueryCrossBorderApprovalStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCrossBorderApprovalStatusResponse
 */
async function queryCrossBorderApprovalStatusWithOptions(request: QueryCrossBorderApprovalStatusRequest, runtime: Util.RuntimeOptions): QueryCrossBorderApprovalStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCrossBorderApprovalStatus',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Inquire about the approval status of cross-border permissions for an Alibaba Cloud account (main account).
 *
 * @param request QueryCrossBorderApprovalStatusRequest
 * @return QueryCrossBorderApprovalStatusResponse
 */
async function queryCrossBorderApprovalStatus(request: QueryCrossBorderApprovalStatusRequest): QueryCrossBorderApprovalStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCrossBorderApprovalStatusWithOptions(request, runtime);
}

model RemoveEntriesFromAclRequest {
  aclEntries?: [ 
    {
      entry?: string(name='Entry', description='The IP address (192.168.XX.XX) or CIDR block (10.0.XX.XX/24) that you want to delete from the ACL. You can delete a maximum of 50 entries at a time.

>  This parameter is required.', example='10.0.XX.XX/24'),
    }
  ](name='AclEntries', description='The entries (IP addresses or CIDR blocks) that you want to delete from the ACL. You can delete a maximum of 20 entries at a time.

This parameter is required.'),
  aclId?: string(name='AclId', description='The ACL ID.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model RemoveEntriesFromAclResponseBody = {
  aclId?: string(name='AclId', description='The ACL ID.', example='nacl-hp34s2h0xx1ht4nwo****'),
  requestId?: string(name='RequestId', description='The request ID.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model RemoveEntriesFromAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveEntriesFromAclResponseBody(name='body'),
}

/**
 * @summary Deletes IP entries from an access control list (ACL).
 *
 * @description *   **RemoveEntriesFromAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) or [ListAcls](https://help.aliyun.com/document_detail/258291.html) operation to query the status of the ACL from which you want to delete IP entries.
 *     *   If the ACL is in the **configuring** state, it indicates that the IP entries are being deleted. In this case, you can perform only query operations.
 *     *   If the ACL is in the **active** state, it indicates that the IP entries are deleted.
 * *   The **RemoveEntriesFromAcl** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request RemoveEntriesFromAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveEntriesFromAclResponse
 */
async function removeEntriesFromAclWithOptions(request: RemoveEntriesFromAclRequest, runtime: Util.RuntimeOptions): RemoveEntriesFromAclResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclEntries)) {
    query['AclEntries'] = request.aclEntries;
  }
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveEntriesFromAcl',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes IP entries from an access control list (ACL).
 *
 * @description *   **RemoveEntriesFromAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetAcl](https://help.aliyun.com/document_detail/258292.html) or [ListAcls](https://help.aliyun.com/document_detail/258291.html) operation to query the status of the ACL from which you want to delete IP entries.
 *     *   If the ACL is in the **configuring** state, it indicates that the IP entries are being deleted. In this case, you can perform only query operations.
 *     *   If the ACL is in the **active** state, it indicates that the IP entries are deleted.
 * *   The **RemoveEntriesFromAcl** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request RemoveEntriesFromAclRequest
 * @return RemoveEntriesFromAclResponse
 */
async function removeEntriesFromAcl(request: RemoveEntriesFromAclRequest): RemoveEntriesFromAclResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeEntriesFromAclWithOptions(request, runtime);
}

model ReplaceBandwidthPackageRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.', example='ga-bp17frjjh0udz4qz****'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the required bandwidth plan. When you specify a replacement bandwidth plan, take note of the following items:

*   Only a bandwidth plan that is not associated with a GA instance can be specified.
*   If you want to replace a basic bandwidth plan, make sure that the bandwidth provided by the replacement bandwidth plan is not less than the total bandwidth allocated to the acceleration area.

This parameter is required.', example='gbwp-bp176neb61yhcymow****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  targetBandwidthPackageId?: string(name='TargetBandwidthPackageId', description='The ID of the bandwidth plan that you want to replace.

This parameter is required.', example='gbwp-o978hgeb61yhcymow****'),
}

model ReplaceBandwidthPackageResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A0EA8CCA-F081-4338-9790-A1C791CCA779'),
}

model ReplaceBandwidthPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReplaceBandwidthPackageResponseBody(name='body'),
}

/**
 * @summary Replaces the bandwidth plans of Global Accelerator (GA) instances.
 *
 * @description When you call this operation, take note of the following items:
 * *   The GA instance continues to forward network traffic.
 * *   **ReplaceBandwidthPackage** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) or [ListAccelerators](https://help.aliyun.com/document_detail/153236.html) operation to query the status of the GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that the associated bandwidth plan is being replaced. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, it indicates that the associated bandwidth plan is replaced.
 * *   The **ReplaceBandwidthPackage** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request ReplaceBandwidthPackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReplaceBandwidthPackageResponse
 */
async function replaceBandwidthPackageWithOptions(request: ReplaceBandwidthPackageRequest, runtime: Util.RuntimeOptions): ReplaceBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.targetBandwidthPackageId)) {
    query['TargetBandwidthPackageId'] = request.targetBandwidthPackageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReplaceBandwidthPackage',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Replaces the bandwidth plans of Global Accelerator (GA) instances.
 *
 * @description When you call this operation, take note of the following items:
 * *   The GA instance continues to forward network traffic.
 * *   **ReplaceBandwidthPackage** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) or [ListAccelerators](https://help.aliyun.com/document_detail/153236.html) operation to query the status of the GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that the associated bandwidth plan is being replaced. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, it indicates that the associated bandwidth plan is replaced.
 * *   The **ReplaceBandwidthPackage** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request ReplaceBandwidthPackageRequest
 * @return ReplaceBandwidthPackageResponse
 */
async function replaceBandwidthPackage(request: ReplaceBandwidthPackageRequest): ReplaceBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return replaceBandwidthPackageWithOptions(request, runtime);
}

model TagResourcesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The ID of the resource to which you want to add tags.

*   If you set **ResourceType** to **accelerator**, set the value of ResourceId to the ID of a standard GA instance.
*   If you set **ResourceType** to **basicaccelerator**, set the value of ResourceId to the ID of a basic GA instance.
*   If you set **ResourceType** to **bandwidthpackage**, set the value of ResourceId to the ID of a bandwidth plan.
*   If you set **ResourceType** to **acl**, set the value of ResourceId to the ID of an ACL.
*   If you set **ResourceType** to **endpointgroup**, set the value of ResourceId to the ID of an endpoint group.

This parameter is required. You can enter up to 50 GA resource IDs.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The type of the resource to which you want to add tags. Valid values:

*   **accelerator:** a standard GA instance.
*   **basicaccelerator:** a basic GA instance.
*   **bandwidthpackage:** a bandwidth plan.
*   **acl:** an ACL.
*   **endpointgroup:** an endpoint group of a standard GA instance. You cannot call the TagResources operation to add tags to an endpoint group of a basic GA instance.

This parameter is required.', example='accelerator'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the GA resource. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag keys.', example='KeyTest'),
      value?: string(name='Value', description='The tag value of the GA resource. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.

You can specify up to 20 tag values.', example='valueTest'),
    }
  ](name='Tag', description='The tags of GA resources.

You can specify up to 20 tags.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to Global Accelerator (GA) resources.
 *
 * @description ### Description
 * You can add up to 20 tags to each GA resource. When you call this operation, Alibaba Cloud first checks the number of existing tags attached to the resource. If the quota is reached, an error message is returned.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds tags to Global Accelerator (GA) resources.
 *
 * @description ### Description
 * You can add up to 20 tags to each GA resource. When you call this operation, Alibaba Cloud first checks the number of existing tags attached to the resource. If the quota is reached, an error message is returned.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags of the specified resource. Valid values:

*   **true**: yes
*   **false** (default): no', example='false'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the resources whose tags you want to remove.

*   If you set **ResourceType** to **accelerator**, set the value of ResourceId to the ID of a standard GA instance.
*   If you set **ResourceType** to **basicaccelerator**, set the value of ResourceId to the ID of a basic GA instance.
*   If you set **ResourceType** to **bandwidthpackage**, set the value of ResourceId to the ID of a bandwidth plan.
*   If you set **ResourceType** to **acl**, set the value of ResourceId to the ID of an ACL.
*   If you set **ResourceType** to **endpointgroup**, set the value of ResourceId to the ID of an endpoint group.

You can specify up to 50 GA resource IDs.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The type of the resource whose tags you want to remove. Valid values:

*   **accelerator**: a standard GA instance
*   **basicaccelerator**: a basic GA instance
*   **bandwidthpackage**: a bandwidth plan
*   **acl**: an access control list (ACL).
*   **endpointgroup**: an endpoint group

This parameter is required.', example='accelerator'),
  tagKey?: [ string ](name='TagKey', description='The key of the tag to be removed.

The system removes all tags with this tag key.

You can specify up to 20 tag keys.

>  If the **All** parameter is set to **true**, this parameter does not take effect.'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from Global Accelerator (GA) resources.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes tags from Global Accelerator (GA) resources.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **false**: disables automatic payment. This is the default value. After an order is generated, you must go to the [Order Center](https://usercenter2-intl.aliyun.com/order/list) to complete the payment.
*   **true**: enables automatic payment. Payments are automatically completed.

>  This parameter takes effect only if you call the operation to upgrade a GA instance.', example='false'),
  autoUseCoupon?: boolean(name='AutoUseCoupon', description='Specifies whether to automatically pay bills by using coupons. Default value: false. Valid values:

*   **true**: automatically pays bills by using coupons.
*   **false**: does not automatically pay bills by using coupons.

>  This parameter takes effect only if the **AutoPay** parameter is set to **true**.', example='false'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567****'),
  description?: string(name='Description', description='The description of the GA instance. The description can be up to 200 characters in length.', example='Accelerator'),
  name?: string(name='Name', description='The name of the GA instance.

The name must be 1 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='Accelerator'),
  regionId?: string(name='RegionId', description='The region where the GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  spec?: string(name='Spec', description='The specification of the GA instance. Valid values:

*   **1**: Small Ⅰ
*   **2**: Small Ⅱ
*   **3**: Small Ⅲ
*   **5**: Medium Ⅰ
*   **8**: Medium Ⅱ
*   **10**: Medium Ⅲ
*   **20**: Large Ⅰ
*   **30**: Large Ⅱ
*   **40**: Large Ⅲ
*   **50**: Large Ⅳ
*   **60**: Large Ⅴ
*   **70**: Large Ⅵ
*   **80**: Large VⅡ
*   **90**: Large VⅢ
*   **100**: Super Large Ⅰ
*   **200**: Super Large Ⅱ

>  The Large Ⅲ specification and higher specifications are available only for accounts that are added to the whitelist. To use these specifications, contact your Alibaba Cloud account manager.

Different specifications provide different capabilities. For more information, see [Instance specifications](https://help.aliyun.com/document_detail/153127.html).', example='1'),
}

model UpdateAcceleratorResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAcceleratorResponseBody(name='body'),
}

/**
 * @summary Modifies a Global Accelerator (GA) instance.
 *
 * @description *   **UpdateAccelerator** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, the GA instance is being modified. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the GA instance is modified.
 * *   The **UpdateAccelerator** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request UpdateAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAcceleratorResponse
 */
async function updateAcceleratorWithOptions(request: UpdateAcceleratorRequest, runtime: Util.RuntimeOptions): UpdateAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.spec)) {
    query['Spec'] = request.spec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a Global Accelerator (GA) instance.
 *
 * @description *   **UpdateAccelerator** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, the GA instance is being modified. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the GA instance is modified.
 * *   The **UpdateAccelerator** operation cannot be repeatedly called for the same GA instance within a specific period of time.
 *
 * @param request UpdateAcceleratorRequest
 * @return UpdateAcceleratorResponse
 */
async function updateAccelerator(request: UpdateAcceleratorRequest): UpdateAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAcceleratorWithOptions(request, runtime);
}

model UpdateAcceleratorAutoRenewAttributeRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the GA instance. Valid values:

*   **true**
*   **false** (default)

>  **AutoRenew** and **RenewalStatus** cannot be left empty at the same time.', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: month.

Valid values: **1** to **12**.

>  This parameter takes effect only if you set **AutoRenew** to **true**.', example='1'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  name?: string(name='Name', description='The name of the GA instance.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.', example='test'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  renewalStatus?: string(name='RenewalStatus', description='Specifies how to renew the GA instance. Valid values:

*   **AutoRenewal**: The system automatically renews the GA instance.
*   **Normal**: You must manually renew the GA instance.
*   **NotRenewal**: The GA instance is not renewed after the instance expires. The system sends only a non-renewal reminder three days before the expiration date. The system no longer reminds you to renew the GA instance. To renew a GA instance whose RenewalStatus is set to NotRenewal, change the value of RenewalStatus from NotRenewal to **Normal**, and then manually renew the instance. You can also set RenewalStatus to **AutoRenewal**.

> 

*   **AutoRenew** and **RenewalStatus** cannot be left empty at the same time.

*   **RenewalStatus** takes precedence over **AutoRenew**. By default, if you do not specify **RenewalStatus**, **AutoRenew** is used.', example='Normal'),
}

model UpdateAcceleratorAutoRenewAttributeResponseBody = {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.', example='ga-bp17frjjh0udz4qz****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model UpdateAcceleratorAutoRenewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAcceleratorAutoRenewAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the auto-renewal settings of a Global Accelerator (GA) instance.
 *
 * @description You cannot repeatedly call the **UpdateAcceleratorAutoRenewAttribute** operation for the same GA instance within a specific period of time.
 *
 * @param request UpdateAcceleratorAutoRenewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAcceleratorAutoRenewAttributeResponse
 */
async function updateAcceleratorAutoRenewAttributeWithOptions(request: UpdateAcceleratorAutoRenewAttributeRequest, runtime: Util.RuntimeOptions): UpdateAcceleratorAutoRenewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.autoRenewDuration)) {
    query['AutoRenewDuration'] = request.autoRenewDuration;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.renewalStatus)) {
    query['RenewalStatus'] = request.renewalStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAcceleratorAutoRenewAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the auto-renewal settings of a Global Accelerator (GA) instance.
 *
 * @description You cannot repeatedly call the **UpdateAcceleratorAutoRenewAttribute** operation for the same GA instance within a specific period of time.
 *
 * @param request UpdateAcceleratorAutoRenewAttributeRequest
 * @return UpdateAcceleratorAutoRenewAttributeResponse
 */
async function updateAcceleratorAutoRenewAttribute(request: UpdateAcceleratorAutoRenewAttributeRequest): UpdateAcceleratorAutoRenewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAcceleratorAutoRenewAttributeWithOptions(request, runtime);
}

model UpdateAcceleratorConfirmRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', description='The region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateAcceleratorConfirmResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateAcceleratorConfirmResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAcceleratorConfirmResponseBody(name='body'),
}

/**
 * @summary Confirms the updated specification of a Global Accelerator (GA) instance.
 *
 * @description After you modify the specification of a GA instance, you must confirm the modification. The **UpdateAcceleratorConfirm** operation is used to confirm the specification of a GA instance that is modified. When you call this operation to confirm the specification of a GA instance, take note of the following items:
 * *   **UpdateAcceleratorConfirm** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that the specification of the instance is being modified. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, it indicates that the specification of the instance is modified.
 * *   The **UpdateAcceleratorConfirm** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 *
 * @param request UpdateAcceleratorConfirmRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAcceleratorConfirmResponse
 */
async function updateAcceleratorConfirmWithOptions(request: UpdateAcceleratorConfirmRequest, runtime: Util.RuntimeOptions): UpdateAcceleratorConfirmResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAcceleratorConfirm',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Confirms the updated specification of a Global Accelerator (GA) instance.
 *
 * @description After you modify the specification of a GA instance, you must confirm the modification. The **UpdateAcceleratorConfirm** operation is used to confirm the specification of a GA instance that is modified. When you call this operation to confirm the specification of a GA instance, take note of the following items:
 * *   **UpdateAcceleratorConfirm** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of a GA instance.
 *     *   If the GA instance is in the **configuring** state, it indicates that the specification of the instance is being modified. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, it indicates that the specification of the instance is modified.
 * *   The **UpdateAcceleratorConfirm** operation cannot be called repeatedly for the same GA instance within a specific period of time.
 *
 * @param request UpdateAcceleratorConfirmRequest
 * @return UpdateAcceleratorConfirmResponse
 */
async function updateAcceleratorConfirm(request: UpdateAcceleratorConfirmRequest): UpdateAcceleratorConfirmResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAcceleratorConfirmWithOptions(request, runtime);
}

model UpdateAcceleratorCrossBorderModeRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

> The bandwidth metering method of the GA instance must be pay-by-data-transfer.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  crossBorderMode?: string(name='CrossBorderMode', description='The type of transmission network of the GA instance. Valid values:

*   **bgpPro**: BGP (Multi-ISP) Pro. BGP (Multi-ISP) Pro lines are used for cross-border acceleration. You do not need to complete real-name verification.
*   **private**: cross-border Express Connect circuit. Cross-border Express Connect circuits provide better acceleration performance but require real-name verification.

This parameter is required.', example='bgpPro'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model UpdateAcceleratorCrossBorderModeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateAcceleratorCrossBorderModeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAcceleratorCrossBorderModeResponseBody(name='body'),
}

/**
 * @summary Changes the type of transmission network for a Global Accelerator (GA) instance.
 *
 * @description You can call this operation to change the type of transmission network for a **standard** GA instance whose bandwidth metering method is **pay-by-data-transfer**. Before you call this operation, make sure that the following requirements are met:
 * *   Cloud Data Transfer (CDT) is activated. When you call the [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html) operation and set **BandwidthBillingType** to **CDT** to create a **standard** GA instance whose bandwidth metering method is **pay-by-data-transfer**, CDT is automatically activated. The data transfer fees are managed by CDT.
 * *   If you want to set **CrossBorderMode** to **private**, which specifies cross-border Express Connect circuit as the type of transmission network, make sure that real-name verification is complete for your enterprise account. For more information, see [Real-name verification](https://help.aliyun.com/document_detail/52595.html).
 *
 * @param request UpdateAcceleratorCrossBorderModeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAcceleratorCrossBorderModeResponse
 */
async function updateAcceleratorCrossBorderModeWithOptions(request: UpdateAcceleratorCrossBorderModeRequest, runtime: Util.RuntimeOptions): UpdateAcceleratorCrossBorderModeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.crossBorderMode)) {
    query['CrossBorderMode'] = request.crossBorderMode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAcceleratorCrossBorderMode',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the type of transmission network for a Global Accelerator (GA) instance.
 *
 * @description You can call this operation to change the type of transmission network for a **standard** GA instance whose bandwidth metering method is **pay-by-data-transfer**. Before you call this operation, make sure that the following requirements are met:
 * *   Cloud Data Transfer (CDT) is activated. When you call the [CreateAccelerator](https://help.aliyun.com/document_detail/206786.html) operation and set **BandwidthBillingType** to **CDT** to create a **standard** GA instance whose bandwidth metering method is **pay-by-data-transfer**, CDT is automatically activated. The data transfer fees are managed by CDT.
 * *   If you want to set **CrossBorderMode** to **private**, which specifies cross-border Express Connect circuit as the type of transmission network, make sure that real-name verification is complete for your enterprise account. For more information, see [Real-name verification](https://help.aliyun.com/document_detail/52595.html).
 *
 * @param request UpdateAcceleratorCrossBorderModeRequest
 * @return UpdateAcceleratorCrossBorderModeResponse
 */
async function updateAcceleratorCrossBorderMode(request: UpdateAcceleratorCrossBorderModeRequest): UpdateAcceleratorCrossBorderModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAcceleratorCrossBorderModeWithOptions(request, runtime);
}

model UpdateAcceleratorCrossBorderStatusRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  crossBorderStatus?: boolean(name='CrossBorderStatus', description='Specifies whether to enable the cross-border acceleration feature for the GA instance. Valid values:

- **true**
- **false**

This parameter is required.', example='true'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to cn-hangzhou.', example='cn-hangzhou'),
}

model UpdateAcceleratorCrossBorderStatusResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateAcceleratorCrossBorderStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAcceleratorCrossBorderStatusResponseBody(name='body'),
}

/**
 * @summary Enables cross-border data transmission for a Global Accelerator (GA) instance.
 *
 * @description You can use this operation to enable or disable the cross-border data transmission feature for a GA instance. Before you enable the cross-border data transmission feature, make sure that the following requirements are met:
 * - **Basic GA instances**:
 * Cloud Data Transfer (CDT) is activated. When you call the CreateBasicAccelerator operation to create a basic GA instance, set BandwidthBillingType to CDT. Then, the system automatically activates CDT. The data transfer fees are managed by CDT.
 * If you want to enable the cross-border data transmission feature, make sure that the current account has completed enterprise real-name registration. For more information, see Real-name registration FAQs.
 * - **Standard GA instances**:
 * CDT is activated. When you call the CreateAccelerator operation to create a standard GA instance, set BandwidthBillingType to CDT. Then, the system automatically activates CDT. The data transfer fees are managed by CDT.
 *
 * @param request UpdateAcceleratorCrossBorderStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAcceleratorCrossBorderStatusResponse
 */
async function updateAcceleratorCrossBorderStatusWithOptions(request: UpdateAcceleratorCrossBorderStatusRequest, runtime: Util.RuntimeOptions): UpdateAcceleratorCrossBorderStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.crossBorderStatus)) {
    query['CrossBorderStatus'] = request.crossBorderStatus;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAcceleratorCrossBorderStatus',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables cross-border data transmission for a Global Accelerator (GA) instance.
 *
 * @description You can use this operation to enable or disable the cross-border data transmission feature for a GA instance. Before you enable the cross-border data transmission feature, make sure that the following requirements are met:
 * - **Basic GA instances**:
 * Cloud Data Transfer (CDT) is activated. When you call the CreateBasicAccelerator operation to create a basic GA instance, set BandwidthBillingType to CDT. Then, the system automatically activates CDT. The data transfer fees are managed by CDT.
 * If you want to enable the cross-border data transmission feature, make sure that the current account has completed enterprise real-name registration. For more information, see Real-name registration FAQs.
 * - **Standard GA instances**:
 * CDT is activated. When you call the CreateAccelerator operation to create a standard GA instance, set BandwidthBillingType to CDT. Then, the system automatically activates CDT. The data transfer fees are managed by CDT.
 *
 * @param request UpdateAcceleratorCrossBorderStatusRequest
 * @return UpdateAcceleratorCrossBorderStatusResponse
 */
async function updateAcceleratorCrossBorderStatus(request: UpdateAcceleratorCrossBorderStatusRequest): UpdateAcceleratorCrossBorderStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAcceleratorCrossBorderStatusWithOptions(request, runtime);
}

model UpdateAclAttributeRequest {
  aclId?: string(name='AclId', description='The ACL ID.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  aclName?: string(name='AclName', description='The ACL name.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

This parameter is required.', example='test-acl'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='02fb3da4****'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true:** performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateAclAttributeResponseBody = {
  aclId?: string(name='AclId', description='The ACL ID.', example='nacl-hp34s2h0xx1ht4nwo****'),
  requestId?: string(name='RequestId', description='The request ID.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model UpdateAclAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAclAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the attributes of an access control list (ACL) of a Global Accelerator (GA) instance.
 *
 * @param request UpdateAclAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAclAttributeResponse
 */
async function updateAclAttributeWithOptions(request: UpdateAclAttributeRequest, runtime: Util.RuntimeOptions): UpdateAclAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.aclName)) {
    query['AclName'] = request.aclName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAclAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the attributes of an access control list (ACL) of a Global Accelerator (GA) instance.
 *
 * @param request UpdateAclAttributeRequest
 * @return UpdateAclAttributeResponse
 */
async function updateAclAttribute(request: UpdateAclAttributeRequest): UpdateAclAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAclAttributeWithOptions(request, runtime);
}

model UpdateAdditionalCertificateWithListenerRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the GA instance.

This parameter is required.', example='ga-bp1odcab8tmno0hdq****'),
  certificateId?: string(name='CertificateId', description='The ID of the replacement certificate.

This parameter is required.', example='6092**-cn-hangzhou'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  domain?: string(name='Domain', description='The domain name associated with the additional certificate that you want to replace.

This parameter is required.', example='example.com'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false:** performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed. This is the default value.', example='false'),
  listenerId?: string(name='ListenerId', description='The ID of the listener. Only HTTPS listeners are supported.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateAdditionalCertificateWithListenerResponseBody = {
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateAdditionalCertificateWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAdditionalCertificateWithListenerResponseBody(name='body'),
}

/**
 * @summary Replaces an expired additional certificate for an HTTPS listener.
 *
 * @description The UpdateAdditionalCertificateWithListener operation is used to replace an additional certificate. This operation is suitable for scenarios in which the original certificate expires and needs to be replaced with a new certificate and the associated domain name remains unchanged.
 * *   **UpdateAdditionalCertificateWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/307743.html) to query the status of the task:
 *     *   If the certificate to be replaced is in the **updating** state, the certificate is being replaced. In this case, you can only query the certificate.
 *     *   If the new certificate is in the **active** state, the new certificate is in effect.
 * *   You cannot repeatedly call the **UpdateAdditionalCertificateWithListener** operation for the same GA instance within a specific period of time.
 *
 * @param request UpdateAdditionalCertificateWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAdditionalCertificateWithListenerResponse
 */
async function updateAdditionalCertificateWithListenerWithOptions(request: UpdateAdditionalCertificateWithListenerRequest, runtime: Util.RuntimeOptions): UpdateAdditionalCertificateWithListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.certificateId)) {
    query['CertificateId'] = request.certificateId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAdditionalCertificateWithListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Replaces an expired additional certificate for an HTTPS listener.
 *
 * @description The UpdateAdditionalCertificateWithListener operation is used to replace an additional certificate. This operation is suitable for scenarios in which the original certificate expires and needs to be replaced with a new certificate and the associated domain name remains unchanged.
 * *   **UpdateAdditionalCertificateWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/307743.html) to query the status of the task:
 *     *   If the certificate to be replaced is in the **updating** state, the certificate is being replaced. In this case, you can only query the certificate.
 *     *   If the new certificate is in the **active** state, the new certificate is in effect.
 * *   You cannot repeatedly call the **UpdateAdditionalCertificateWithListener** operation for the same GA instance within a specific period of time.
 *
 * @param request UpdateAdditionalCertificateWithListenerRequest
 * @return UpdateAdditionalCertificateWithListenerResponse
 */
async function updateAdditionalCertificateWithListener(request: UpdateAdditionalCertificateWithListenerRequest): UpdateAdditionalCertificateWithListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAdditionalCertificateWithListenerWithOptions(request, runtime);
}

model UpdateApplicationMonitorRequest {
  address?: string(name='Address', description='The URL or IP address that is probed.', example='https://www.aliyun.com'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  detectEnable?: boolean(name='DetectEnable', description='Specifies whether to enable the automatic diagnostics feature. Valid values:

*   **true**
*   **false** (default)', example='false'),
  detectThreshold?: int32(name='DetectThreshold', description='Set the threshold that is used to trigger the automatic diagnostics feature. If the liveness of the origin in percentile drops below the specified threshold, the automatic diagnostics feature is triggered.

Valid values: **0** to **100**.', example='0'),
  detectTimes?: int32(name='DetectTimes', description='The number of times that the threshold must be reached before the automatic diagnostics feature is triggered.

Valid values: **1** to **20**.', example='1'),
  listenerId?: string(name='ListenerId', description='The ID of the listener that you want to modify. The listener runs the origin probing task.', example='lsr-bp1bpn0kn908w4nbw****'),
  optionsJson?: string(name='OptionsJson', description='The extended options of the listener protocol that is used by the origin probing task. The options vary based on the listener protocol.', example='{ "http_method": "get","header": "key:asd","acceptable_response_code": "500","cert_verify": true }'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  silenceTime?: int32(name='SilenceTime', description='The silence period of the automatic diagnostics feature. This parameter specifies the interval at which the automatic diagnostics feature is triggered. If the availability rate does not return to normal after GA triggers an automatic diagnostic task, GA must wait until the silence period ends before GA can trigger another automatic diagnostic task.

If the number of consecutive times that the availability rate drops below the threshold of automatic diagnostics reaches the value of the **DetectTimes** parameter, the automatic diagnostics feature is triggered. The automatic diagnostics feature is not triggered again within the silence period even if the availability rate stays below the threshold. If the availability rate does not return to normal after the silence period ends, the automatic diagnostics feature is triggered again.

Unit: seconds. Valid values: **300** to **86400**.', example='300'),
  taskId?: string(name='TaskId', description='The ID of the origin probing task that you want to modify.

This parameter is required.', example='sm-bp1fpdjfju9k8yr1y****'),
  taskName?: string(name='TaskName', description='The name of the origin probing task.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='task1'),
}

model UpdateApplicationMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateApplicationMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationMonitorResponseBody(name='body'),
}

/**
 * @summary Modifies an origin probing task.
 *
 * @description **UpdateApplicationMonitor** is an asynchronous operation. After you send a request, the system returns a request ID, but this operation is still being performed in the system background. You can call the [DescribeApplicationMonitor](https://help.aliyun.com/document_detail/408463.html) or [ListApplicationMonitor](https://help.aliyun.com/document_detail/408462.html) operation to check whether the configurations of an origin probing task are modified.
 * *   If the values of modified parameters remain unchanged, it indicates that the origin probing task is being modified. In this case, you can perform only query operations.
 * *   If the values of modified parameters change, it indicates that the origin probing task is modified.
 *
 * @param request UpdateApplicationMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationMonitorResponse
 */
async function updateApplicationMonitorWithOptions(request: UpdateApplicationMonitorRequest, runtime: Util.RuntimeOptions): UpdateApplicationMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.detectEnable)) {
    query['DetectEnable'] = request.detectEnable;
  }
  if (!Util.isUnset(request.detectThreshold)) {
    query['DetectThreshold'] = request.detectThreshold;
  }
  if (!Util.isUnset(request.detectTimes)) {
    query['DetectTimes'] = request.detectTimes;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.optionsJson)) {
    query['OptionsJson'] = request.optionsJson;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApplicationMonitor',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an origin probing task.
 *
 * @description **UpdateApplicationMonitor** is an asynchronous operation. After you send a request, the system returns a request ID, but this operation is still being performed in the system background. You can call the [DescribeApplicationMonitor](https://help.aliyun.com/document_detail/408463.html) or [ListApplicationMonitor](https://help.aliyun.com/document_detail/408462.html) operation to check whether the configurations of an origin probing task are modified.
 * *   If the values of modified parameters remain unchanged, it indicates that the origin probing task is being modified. In this case, you can perform only query operations.
 * *   If the values of modified parameters change, it indicates that the origin probing task is modified.
 *
 * @param request UpdateApplicationMonitorRequest
 * @return UpdateApplicationMonitorResponse
 */
async function updateApplicationMonitor(request: UpdateApplicationMonitorRequest): UpdateApplicationMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateApplicationMonitorWithOptions(request, runtime);
}

model UpdateBandwidthPackagaAutoRenewAttributeRequest {
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**
*   **false** (default)

>  You must specify **AutoRenew** or **RenewalStatus**.', example='false'),
  autoRenewDuration?: int32(name='AutoRenewDuration', description='The auto-renewal duration. Unit: months. Valid values: **1** to **12**.

> This parameter takes effect only if **AutoRenew** is set to **true**.', example='1'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  instanceId?: string(name='InstanceId', description='The ID of the bandwidth plan.

This parameter is required.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  name?: string(name='Name', description='The name of the bandwidth plan.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  renewalStatus?: string(name='RenewalStatus', description='The auto-renewal status of the bandwidth plan. Valid values:

*   **AutoRenewal**: The bandwidth plan is automatically renewed.
*   **Normal**: You must manually renew the bandwidth plan.
*   **NotRenewal**: The bandwidth plan is not renewed after it expires. The system sends only a non-renewal reminder three days before the expiration date. To renew a bandwidth plan for which you set RenewalStatus to NotRenewal, you can change the value of RenewalStatus from NotRenewal to Normal, and then manually renew the bandwidth plan. You can also set RenewalStatus to **AutoRenewal**.
> *   You must specify **AutoRenew** or **RenewalStatus**.
> *   **RenewalStatus** takes precedence over **AutoRenew**. If you do not specify **RenewalStatus**, **AutoRenew** is used.', example='Normal'),
}

model UpdateBandwidthPackagaAutoRenewAttributeResponseBody = {
  instanceId?: string(name='InstanceId', description='The ID of the bandwidth plan.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model UpdateBandwidthPackagaAutoRenewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBandwidthPackagaAutoRenewAttributeResponseBody(name='body'),
}

/**
 * @summary Changes the auto-renewal status of a bandwidth plan.
 *
 * @description You cannot repeatedly call the **UpdateBandwidthPackagaAutoRenewAttribute** operation to modify the auto-renewal settings of a bandwidth plan.
 *
 * @param request UpdateBandwidthPackagaAutoRenewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBandwidthPackagaAutoRenewAttributeResponse
 */
async function updateBandwidthPackagaAutoRenewAttributeWithOptions(request: UpdateBandwidthPackagaAutoRenewAttributeRequest, runtime: Util.RuntimeOptions): UpdateBandwidthPackagaAutoRenewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.autoRenewDuration)) {
    query['AutoRenewDuration'] = request.autoRenewDuration;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.renewalStatus)) {
    query['RenewalStatus'] = request.renewalStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBandwidthPackagaAutoRenewAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the auto-renewal status of a bandwidth plan.
 *
 * @description You cannot repeatedly call the **UpdateBandwidthPackagaAutoRenewAttribute** operation to modify the auto-renewal settings of a bandwidth plan.
 *
 * @param request UpdateBandwidthPackagaAutoRenewAttributeRequest
 * @return UpdateBandwidthPackagaAutoRenewAttributeResponse
 */
async function updateBandwidthPackagaAutoRenewAttribute(request: UpdateBandwidthPackagaAutoRenewAttributeRequest): UpdateBandwidthPackagaAutoRenewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBandwidthPackagaAutoRenewAttributeWithOptions(request, runtime);
}

model UpdateBandwidthPackageRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **false**: disables automatic payment. This is the default value. If you select this option, you must go to [Order Center](https://usercenter2-intl.aliyun.com/order/list) to complete the payment after an order is generated.
*   **true**: enables automatic payment. Payments are automatically completed.

>  This parameter takes effect only if you call the UpdateBandwidthPackage operation to upgrade a bandwidth plan.', example='false'),
  autoUseCoupon?: boolean(name='AutoUseCoupon', description='Specifies whether to use coupons. Valid values:

*   **true**
*   **false** (default)', example='false'),
  bandwidth?: int32(name='Bandwidth', description='The bandwidth value of the bandwidth plan. Unit: Mbit/s.

Valid values: **2** to **2000**.', example='2'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the bandwidth plan that you want to modify.

This parameter is required.', example='gbwp-bp1sgzldyj6b4q7cx****'),
  bandwidthType?: string(name='BandwidthType', description='The type of bandwidth. Valid values:

*   **Basic**
*   **Enhanced**
*   **Advanced**

>  You can upgrade **Basic** bandwidth to **Enhanced** bandwidth or downgrade Enhanced bandwidth to Basic bandwidth. You cannot change **Advanced** bandwidth to another type of bandwidth.', example='Basic'),
  description?: string(name='Description', description='The description of the bandwidth plan.

The description can be up to 256 characters in length.', example='testDescription'),
  name?: string(name='Name', description='The name of the bandwidth plan. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='testName'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateBandwidthPackageResponseBody = {
  bandwidthPackage?: string(name='BandwidthPackage', description='The bandwidth plan ID.', example='gbwp-bp1eo4f57z1kbbcmn****'),
  description?: string(name='Description', description='The description of the bandwidth plan.', example='testDescription'),
  name?: string(name='Name', description='The name of the bandwidth plan.', example='testName'),
  requestId?: string(name='RequestId', description='The request ID.', example='1DF3A3CB-B621-44F8-9870-C20D034D7AB'),
}

model UpdateBandwidthPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBandwidthPackageResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a bandwidth plan.
 *
 * @description Take note of the following items:
 * *   **UpdateBandwidthPackage** is a synchronous operation when you call the operation to modify the configuration excluding the bandwidth value of a bandwidth plan. The new configuration immediately takes effect after the operation is performed.
 * *   **UpdateBandwidthPackage** is an asynchronous operation when you call the operation to modify the configuration including the bandwidth value of a bandwidth plan that is not associated with a Global Accelerator (GA) instance. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the task.
 *     *   If the parameter values of the bandwidth plan remain unchanged, the bandwidth plan is being modified. In this case, you can perform only query operations.
 *     *   If the parameter values of the bandwidth plan are changed, the bandwidth plan is modified.
 * *   **UpdateBandwidthPackage** is an asynchronous operation when you call the operation to modify the configuration including the bandwidth value of a bandwidth plan that is associated with a GA instance. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of the task.
 *     *   If the GA instance is in the **configuring** state, the bandwidth plan is being modified. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the bandwidth plan is modified.
 * *   You cannot repeatedly call the **UpdateBandwidthPackage** operation for the same bandwidth plan within a specific period of time.
 *
 * @param request UpdateBandwidthPackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBandwidthPackageResponse
 */
async function updateBandwidthPackageWithOptions(request: UpdateBandwidthPackageRequest, runtime: Util.RuntimeOptions): UpdateBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!Util.isUnset(request.bandwidthType)) {
    query['BandwidthType'] = request.bandwidthType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBandwidthPackage',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of a bandwidth plan.
 *
 * @description Take note of the following items:
 * *   **UpdateBandwidthPackage** is a synchronous operation when you call the operation to modify the configuration excluding the bandwidth value of a bandwidth plan. The new configuration immediately takes effect after the operation is performed.
 * *   **UpdateBandwidthPackage** is an asynchronous operation when you call the operation to modify the configuration including the bandwidth value of a bandwidth plan that is not associated with a Global Accelerator (GA) instance. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeBandwidthPackage](https://help.aliyun.com/document_detail/153241.html) operation to query the status of the task.
 *     *   If the parameter values of the bandwidth plan remain unchanged, the bandwidth plan is being modified. In this case, you can perform only query operations.
 *     *   If the parameter values of the bandwidth plan are changed, the bandwidth plan is modified.
 * *   **UpdateBandwidthPackage** is an asynchronous operation when you call the operation to modify the configuration including the bandwidth value of a bandwidth plan that is associated with a GA instance. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeAccelerator](https://help.aliyun.com/document_detail/153235.html) operation to query the status of the task.
 *     *   If the GA instance is in the **configuring** state, the bandwidth plan is being modified. In this case, you can perform only query operations.
 *     *   If the GA instance is in the **active** state, the bandwidth plan is modified.
 * *   You cannot repeatedly call the **UpdateBandwidthPackage** operation for the same bandwidth plan within a specific period of time.
 *
 * @param request UpdateBandwidthPackageRequest
 * @return UpdateBandwidthPackageResponse
 */
async function updateBandwidthPackage(request: UpdateBandwidthPackageRequest): UpdateBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBandwidthPackageWithOptions(request, runtime);
}

model UpdateBasicAcceleratorRequest {
  acceleratorId?: string(name='AcceleratorId', description='The ID of the basic GA instance.

This parameter is required.', example='ga-bp17frjjh0udz4qz****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567****'),
  description?: string(name='Description', description='The description of the basic GA instance.

The description can be up to 200 characters in length and cannot start with `http://` or `https://`.', example='BasicAccelerator'),
  name?: string(name='Name', description='The name of the basic GA instance.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='BasicAccelerator'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model UpdateBasicAcceleratorResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='F591955F-5CB5-4CCE-A75D-17CF2085CE22'),
}

model UpdateBasicAcceleratorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBasicAcceleratorResponseBody(name='body'),
}

/**
 * @summary Modifies the name and description of a basic Global Accelerator (GA) instance.
 *
 * @param request UpdateBasicAcceleratorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBasicAcceleratorResponse
 */
async function updateBasicAcceleratorWithOptions(request: UpdateBasicAcceleratorRequest, runtime: Util.RuntimeOptions): UpdateBasicAcceleratorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBasicAccelerator',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the name and description of a basic Global Accelerator (GA) instance.
 *
 * @param request UpdateBasicAcceleratorRequest
 * @return UpdateBasicAcceleratorResponse
 */
async function updateBasicAccelerator(request: UpdateBasicAcceleratorRequest): UpdateBasicAcceleratorResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBasicAcceleratorWithOptions(request, runtime);
}

model UpdateBasicEndpointRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoint that you want to modify belongs.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint that you want to modify.

This parameter is required.', example='ep-bp14sz7ftcwwjgrdm****'),
  name?: string(name='Name', description='The name of the endpoint that is associated with the basic GA instance.

The name must be 1 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

This parameter is required.', example='ep01'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateBasicEndpointResponseBody = {
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoints belong.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint.', example='ep-bp14sz7ftcwwjgrdm****'),
  name?: string(name='Name', description='The name of the endpoint.', example='ep01'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateBasicEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBasicEndpointResponseBody(name='body'),
}

/**
 * @summary Modifies the name of an endpoint that is associated with a basic Global Accelerator (GA) instance.
 *
 * @param request UpdateBasicEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBasicEndpointResponse
 */
async function updateBasicEndpointWithOptions(request: UpdateBasicEndpointRequest, runtime: Util.RuntimeOptions): UpdateBasicEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBasicEndpoint',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the name of an endpoint that is associated with a basic Global Accelerator (GA) instance.
 *
 * @param request UpdateBasicEndpointRequest
 * @return UpdateBasicEndpointResponse
 */
async function updateBasicEndpoint(request: UpdateBasicEndpointRequest): UpdateBasicEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBasicEndpointWithOptions(request, runtime);
}

model UpdateBasicEndpointGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the endpoint group.

The description can be up to 200 characters in length and cannot start with `http://` or `https://`.', example='BasicEndpointGroup'),
  endpointAddress?: string(name='EndpointAddress', description='The address of the endpoint.', example='eni-bp1a05txelswuj8g****'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointSubAddress?: string(name='EndpointSubAddress', description='The secondary address of the endpoint.

This parameter is required only if the accelerated IP address is associated with the secondary private IP address of an ECS instance or an ENI.

*   If you set the endpoint type to **ECS**, you can set **EndpointSubAddress** to the secondary private IP address of the primary ENI. If you leave this parameter empty, the primary private IP address of the primary ENI is used.
*   If you set the endpoint type to **ENI**, you can set **EndpointSubAddress** to the secondary private IP address of the secondary ENI. If you leave this parameter empty, the primary private IP address of the secondary ENI is used.', example='172.16.XX.XX'),
  endpointType?: string(name='EndpointType', description='The type of the endpoint. Valid values:

*   **ENI**: elastic network interface (ENI).
*   **SLB**: Classic Load Balancer (CLB) instance.
*   **ECS**: Elastic Compute Service (ECS) instance.', example='ENI'),
  name?: string(name='Name', description='The name of the endpoint group.

The name must be 1 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.', example='group1'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateBasicEndpointGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateBasicEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBasicEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of an endpoint group that is associated with a basic Global Accelerator (GA) instance.
 *
 * @description *   **UpdateBasicEndpointGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. The system modifies the configurations of an endpoint group that is associated with a basic GA instance by deleting the endpoint group and creating a new endpoint group. You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/353188.html) operation to query the status of the task.
 *     *   If the basic GA instance is in the **configuring** state, the configurations of the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If the basic GA instance is in the **active** state, the configurations of the endpoint group are modified.
 * *   The **UpdateBasicEndpointGroup** operation cannot be repeatedly called for the same basic GA instance within a specific period of time.
 *
 * @param request UpdateBasicEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBasicEndpointGroupResponse
 */
async function updateBasicEndpointGroupWithOptions(request: UpdateBasicEndpointGroupRequest, runtime: Util.RuntimeOptions): UpdateBasicEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointAddress)) {
    query['EndpointAddress'] = request.endpointAddress;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointSubAddress)) {
    query['EndpointSubAddress'] = request.endpointSubAddress;
  }
  if (!Util.isUnset(request.endpointType)) {
    query['EndpointType'] = request.endpointType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBasicEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of an endpoint group that is associated with a basic Global Accelerator (GA) instance.
 *
 * @description *   **UpdateBasicEndpointGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. The system modifies the configurations of an endpoint group that is associated with a basic GA instance by deleting the endpoint group and creating a new endpoint group. You can call the [GetBasicAccelerator](https://help.aliyun.com/document_detail/353188.html) operation to query the status of the task.
 *     *   If the basic GA instance is in the **configuring** state, the configurations of the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If the basic GA instance is in the **active** state, the configurations of the endpoint group are modified.
 * *   The **UpdateBasicEndpointGroup** operation cannot be repeatedly called for the same basic GA instance within a specific period of time.
 *
 * @param request UpdateBasicEndpointGroupRequest
 * @return UpdateBasicEndpointGroupResponse
 */
async function updateBasicEndpointGroup(request: UpdateBasicEndpointGroupRequest): UpdateBasicEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBasicEndpointGroupWithOptions(request, runtime);
}

model UpdateBasicIpSetRequest {
  bandwidth?: int32(name='Bandwidth', description='The bandwidth of the acceleration region. Unit: Mbit/s.

The minimum bandwidth is 2 Mbit/s.

This parameter is required.', example='2'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region of the basic GA instance.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateBasicIpSetResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6D2BFF54-6AF2-4679-88C4-2F2E187F16CB'),
}

model UpdateBasicIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBasicIpSetResponseBody(name='body'),
}

/**
 * @summary Modifies the bandwidth of an acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @description Before you call this operation, take note of the following limits:
 * *   You can modify the bandwidth of an acceleration region of a basic GA instance only if the bandwidth metering method of the basic GA instance is **pay-by-data-transfer**.
 * *   **UpdateBasicIpSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicIpSet](https://help.aliyun.com/document_detail/362987.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **updating** state, it indicates that the bandwidth of the acceleration region is being modified. In this case, you can perform only query operations.
 *     *   If the acceleration region is in the **active** state, it indicates that the bandwidth of the acceleration region is modified.
 * *   You cannot repeatedly call the **UpdateBasicIpSet** operation for the same basic GA instance within a specific period of time.
 *
 * @param request UpdateBasicIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBasicIpSetResponse
 */
async function updateBasicIpSetWithOptions(request: UpdateBasicIpSetRequest, runtime: Util.RuntimeOptions): UpdateBasicIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBasicIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the bandwidth of an acceleration region of a basic Global Accelerator (GA) instance.
 *
 * @description Before you call this operation, take note of the following limits:
 * *   You can modify the bandwidth of an acceleration region of a basic GA instance only if the bandwidth metering method of the basic GA instance is **pay-by-data-transfer**.
 * *   **UpdateBasicIpSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetBasicIpSet](https://help.aliyun.com/document_detail/362987.html) operation to query the status of the task.
 *     *   If the acceleration region is in the **updating** state, it indicates that the bandwidth of the acceleration region is being modified. In this case, you can perform only query operations.
 *     *   If the acceleration region is in the **active** state, it indicates that the bandwidth of the acceleration region is modified.
 * *   You cannot repeatedly call the **UpdateBasicIpSet** operation for the same basic GA instance within a specific period of time.
 *
 * @param request UpdateBasicIpSetRequest
 * @return UpdateBasicIpSetResponse
 */
async function updateBasicIpSet(request: UpdateBasicIpSetRequest): UpdateBasicIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBasicIpSetWithOptions(request, runtime);
}

model UpdateCustomRoutingEndpointGroupAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The endpoint group description.

The description can be up to 256 characters in length and cannot contain `http://` or `https://`.', example='EndpointGroup'),
  endpointGroupId?: string(name='EndpointGroupId', description='The endpoint group ID.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  name?: string(name='Name', description='The endpoint group name.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.', example='group1'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateCustomRoutingEndpointGroupAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateCustomRoutingEndpointGroupAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomRoutingEndpointGroupAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the name and description of an endpoint group that is associated with a custom routing listener.
 *
 * @param request UpdateCustomRoutingEndpointGroupAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomRoutingEndpointGroupAttributeResponse
 */
async function updateCustomRoutingEndpointGroupAttributeWithOptions(request: UpdateCustomRoutingEndpointGroupAttributeRequest, runtime: Util.RuntimeOptions): UpdateCustomRoutingEndpointGroupAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomRoutingEndpointGroupAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the name and description of an endpoint group that is associated with a custom routing listener.
 *
 * @param request UpdateCustomRoutingEndpointGroupAttributeRequest
 * @return UpdateCustomRoutingEndpointGroupAttributeResponse
 */
async function updateCustomRoutingEndpointGroupAttribute(request: UpdateCustomRoutingEndpointGroupAttributeRequest): UpdateCustomRoutingEndpointGroupAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomRoutingEndpointGroupAttributeWithOptions(request, runtime);
}

model UpdateCustomRoutingEndpointGroupDestinationsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among all requests. The client token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the value of **RequestId** as the value of **ClientToken**. The value of **RequestId** for each API request may be different.', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationConfigurations?: [ 
    {
      destinationId?: string(name='DestinationId', description='The ID of the mapping configuration of the endpoint group.

This parameter is required.', example='dst-abc123****'),
      fromPort?: int32(name='FromPort', description='The start port of the backend service port range of the endpoint group.

Valid values: **1** to **65499**. The **FromPort** value must be smaller than or equal to the **ToPort** value.

You can specify up to 20 start ports in each request.', example='80'),
      protocols?: [ string ](name='Protocols', description='The backend service protocol of the endpoint group. Valid values:

*   **tcp**: TCP
*   **udp**: UDP
*   **tcp,udp**: TCP and UDP

You can specify up to four backend service protocols in each configuration.'),
      toPort?: int32(name='ToPort', description='The end port of the backend service port range of the endpoint group.

Valid values: **1** to **65499**. The **FromPort** value must be smaller than or equal to the **ToPort** value.

You can specify up to 20 end ports in each request.', example='80'),
    }
  ](name='DestinationConfigurations', description='The mapping configurations of endpoint group.

You must specify the backend service port range and protocol of the endpoint group. The specified information is used to map the port range of the associated listener.

You can specify at most 20 mapping configurations, which include port ranges and protocol types.

This parameter is required.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateCustomRoutingEndpointGroupDestinationsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateCustomRoutingEndpointGroupDestinationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomRoutingEndpointGroupDestinationsResponseBody(name='body'),
}

/**
 * @summary Modifies the mapping configurations of an endpoint group that is associated with a custom routing listener.
 *
 * @description *   **UpdateCustomRoutingEndpointGroupDestinations** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of an endpoint group associated with a custom routing listener to check whether the mapping configurations of the endpoint group are modified.
 *     *   If the endpoint group is in the **updating** state, the mapping configurations of the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, the mapping configurations of the endpoint group are modified.
 * *   The **UpdateCustomRoutingEndpointGroupDestinations** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateCustomRoutingEndpointGroupDestinationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomRoutingEndpointGroupDestinationsResponse
 */
async function updateCustomRoutingEndpointGroupDestinationsWithOptions(request: UpdateCustomRoutingEndpointGroupDestinationsRequest, runtime: Util.RuntimeOptions): UpdateCustomRoutingEndpointGroupDestinationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationConfigurations)) {
    query['DestinationConfigurations'] = request.destinationConfigurations;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomRoutingEndpointGroupDestinations',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the mapping configurations of an endpoint group that is associated with a custom routing listener.
 *
 * @description *   **UpdateCustomRoutingEndpointGroupDestinations** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of an endpoint group associated with a custom routing listener to check whether the mapping configurations of the endpoint group are modified.
 *     *   If the endpoint group is in the **updating** state, the mapping configurations of the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, the mapping configurations of the endpoint group are modified.
 * *   The **UpdateCustomRoutingEndpointGroupDestinations** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateCustomRoutingEndpointGroupDestinationsRequest
 * @return UpdateCustomRoutingEndpointGroupDestinationsResponse
 */
async function updateCustomRoutingEndpointGroupDestinations(request: UpdateCustomRoutingEndpointGroupDestinationsRequest): UpdateCustomRoutingEndpointGroupDestinationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomRoutingEndpointGroupDestinationsWithOptions(request, runtime);
}

model UpdateCustomRoutingEndpointTrafficPoliciesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointId?: string(name='EndpointId', description='The ID of the endpoint for which you want to modify the traffic policies.

This parameter is required.', example='ep-2zewuzypq5e6r3pfh****'),
  policyConfigurations?: [ 
    {
      address?: string(name='Address', description='The IP address of the destination which to allow traffic.

This parameter takes effect only when you set the **TrafficToEndpointPolicy** parameter to **AllowCustom**. You can call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation to query the traffic policy of an endpoint.

You can specify a maximum of 500 traffic policies for each endpoint.

>  This parameter is required.', example='10.0.XX.XX'),
      policyId?: string(name='PolicyId', description='The ID of the traffic policy that you want to modify.

>  This parameter is required.', example='ply-bptest2****'),
      portRanges?: [ 
        {
          fromPort?: int32(name='FromPort', description='The first port of the destination port range. The value of this parameter must fall within the port range of the backend service.

This parameter takes effect only when you set the **TrafficToEndpointPolicy** parameter to **AllowCustom**. You can call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation to query the traffic policy of an endpoint.

If the start port and end port values are empty, traffic on all ports of the destination is allowed.

You can specify a maximum of 500 port ranges for each endpoint and a maximum of 10 port ranges for each traffic policy.', example='80'),
          toPort?: int32(name='ToPort', description='The last port of the destination port range. The value of this parameter must fall within the port range of the backend service.

This parameter takes effect only when you set the **TrafficToEndpointPolicy** parameter to **AllowCustom**. You can call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation to query the traffic policy of an endpoint.

If the start port and end port values are empty, traffic on all ports of the destination is allowed.

You can specify a maximum of 500 port ranges for each endpoint and a maximum of 10 port ranges for each traffic policy.', example='80'),
        }
      ](name='PortRanges', description='The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you do not specify object, traffic is forwarded to all ports.

This parameter takes effect only when you set the **TrafficToEndpointPolicy** parameter to **AllowCustom**. You can call the [DescribeCustomRoutingEndpoint](https://help.aliyun.com/document_detail/449386.html) operation to query the traffic policy of an endpoint.

You can specify a maximum of 500 port ranges for each endpoint and a maximum of 10 port ranges for each traffic policy.'),
    }
  ](name='PolicyConfigurations', description='The access policies.

You can specify a maximum of 500 traffic policies for each endpoint.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateCustomRoutingEndpointTrafficPoliciesResponseBody = {
  policyIds?: [ string ](name='PolicyIds', description='The IDs of the traffic destinations.'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateCustomRoutingEndpointTrafficPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomRoutingEndpointTrafficPoliciesResponseBody(name='body'),
}

/**
 * @summary Modifies the traffic policies for an endpoint that is associated with a custom routing listener.
 *
 * @description *   **UpdateCustomRoutingEndpointTrafficPolicies** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, traffic policies are being modified for endpoints in the endpoint group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, traffic policies are modified for endpoints in the endpoint group.
 * *   The **UpdateCustomRoutingEndpointTrafficPolicies** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateCustomRoutingEndpointTrafficPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomRoutingEndpointTrafficPoliciesResponse
 */
async function updateCustomRoutingEndpointTrafficPoliciesWithOptions(request: UpdateCustomRoutingEndpointTrafficPoliciesRequest, runtime: Util.RuntimeOptions): UpdateCustomRoutingEndpointTrafficPoliciesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.policyConfigurations)) {
    query['PolicyConfigurations'] = request.policyConfigurations;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomRoutingEndpointTrafficPolicies',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the traffic policies for an endpoint that is associated with a custom routing listener.
 *
 * @description *   **UpdateCustomRoutingEndpointTrafficPolicies** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the status of the task.
 *     *   If the endpoint group is in the **updating** state, traffic policies are being modified for endpoints in the endpoint group. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, traffic policies are modified for endpoints in the endpoint group.
 * *   The **UpdateCustomRoutingEndpointTrafficPolicies** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateCustomRoutingEndpointTrafficPoliciesRequest
 * @return UpdateCustomRoutingEndpointTrafficPoliciesResponse
 */
async function updateCustomRoutingEndpointTrafficPolicies(request: UpdateCustomRoutingEndpointTrafficPoliciesRequest): UpdateCustomRoutingEndpointTrafficPoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomRoutingEndpointTrafficPoliciesWithOptions(request, runtime);
}

model UpdateCustomRoutingEndpointsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The client token can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** may be different for each API request.', example='123e4567-e89b-12d3-a456-426655440000'),
  endpointConfigurations?: [ 
    {
      endpointId?: string(name='EndpointId', description='The ID of the endpoint.

You can specify up to 20 endpoint IDs.', example='ep-bp1dmlohjjz4kqaun****'),
      policyConfigurations?: [ 
        {
          address?: string(name='Address', description='The IP address of the destination to which to allow traffic.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify up to 20 destination IP addresses for each endpoint.', example='10.0.XX.XX'),
          portRanges?: [ 
            {
              fromPort?: string(name='FromPort', description='The start port of the port range in the destination to which to allow traffic. The specified port must fall within the port range of the specified endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 start ports for each destination.', example='80'),
              toPort?: string(name='ToPort', description='The end port of the port range in the destination to which to allow traffic. The specified port must fall within the port range of the specified endpoint group.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 end ports for each destination.', example='80'),
            }
          ](name='PortRanges', description='The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you leave this parameter empty, traffic is forwarded to all destination ports.

This parameter takes effect only when **TrafficToEndpointPolicy** is set to **AllowCustom**.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 port ranges for each destination.'),
        }
      ](name='PolicyConfigurations', description='The configurations of the policy.'),
      trafficToEndpointPolicy?: string(name='TrafficToEndpointPolicy', description='The access policy of traffic for the specified endpoint. Default value: DenyAll. Valid values:

*   **DenyAll**: denies all traffic to the endpoint.

*   **AllowAll**: allows all traffic to the endpoint.

*   **AllowCustom**: allows traffic only to specified destinations.

    If you set this parameter to AllowCustom, you must specify IP addresses and port ranges of destinations to which to allow traffic. If you specify only IP addresses and do not specify port ranges, GA can forward traffic to all ports and the specified IP addresses in the destinations.

You can specify up to 20 access policies of traffic for the specified endpoint.', example='DenyAll'),
    }
  ](name='EndpointConfigurations', description='The configurations of the endpoint.

This parameter is required.'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group to which the endpoints that you want to modify belong.

This parameter is required.', example='epg-bp1bpn0kn908w4nb****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateCustomRoutingEndpointsResponseBody = {
  endpointIds?: [ string ](name='EndpointIds', description='The IDs of the endpoints.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateCustomRoutingEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomRoutingEndpointsResponseBody(name='body'),
}

/**
 * @summary Modifies the endpoints of a custom routing listener.
 *
 * @description ## Description
 * *   **UpdateCustomRoutingEndpoints** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the state of the endpoint groups associated with a custom routing listener to check whether the endpoints in the endpoint groups are modified.
 *     *   If an endpoint group is in the **updating** state, the endpoints in the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If an endpoint group is in the **active** state, the endpoints in the endpoint group are modified.
 * *   The **UpdateCustomRoutingEndpoints** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateCustomRoutingEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomRoutingEndpointsResponse
 */
async function updateCustomRoutingEndpointsWithOptions(request: UpdateCustomRoutingEndpointsRequest, runtime: Util.RuntimeOptions): UpdateCustomRoutingEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endpointConfigurations)) {
    query['EndpointConfigurations'] = request.endpointConfigurations;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomRoutingEndpoints',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the endpoints of a custom routing listener.
 *
 * @description ## Description
 * *   **UpdateCustomRoutingEndpoints** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeCustomRoutingEndpointGroup](https://help.aliyun.com/document_detail/449373.html) operation to query the state of the endpoint groups associated with a custom routing listener to check whether the endpoints in the endpoint groups are modified.
 *     *   If an endpoint group is in the **updating** state, the endpoints in the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If an endpoint group is in the **active** state, the endpoints in the endpoint group are modified.
 * *   The **UpdateCustomRoutingEndpoints** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateCustomRoutingEndpointsRequest
 * @return UpdateCustomRoutingEndpointsResponse
 */
async function updateCustomRoutingEndpoints(request: UpdateCustomRoutingEndpointsRequest): UpdateCustomRoutingEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomRoutingEndpointsWithOptions(request, runtime);
}

model UpdateDomainRequest {
  domain?: string(name='Domain', description='The new accelerated domain name.

Only primary domain names are supported, such as `example.net`.

This parameter is required.', example='example.net'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  targetDomain?: string(name='TargetDomain', description='The accelerated domain name to be modified.

This parameter is required.', example='example.com'),
}

model UpdateDomainResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDomainResponseBody(name='body'),
}

/**
 * @summary Modifies an accelerated domain name.
 *
 * @description You can call this operation to modify an accelerated domain name. If the new accelerated domain name is hosted in the Chinese mainland, you must obtain an Internet content provider (ICP) number for the domain name.
 * You cannot call the **UpdateDomain** operation again by using the same Alibaba Cloud account before the previous request is completed.
 *
 * @param request UpdateDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDomainResponse
 */
async function updateDomainWithOptions(request: UpdateDomainRequest, runtime: Util.RuntimeOptions): UpdateDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.targetDomain)) {
    query['TargetDomain'] = request.targetDomain;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDomain',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an accelerated domain name.
 *
 * @description You can call this operation to modify an accelerated domain name. If the new accelerated domain name is hosted in the Chinese mainland, you must obtain an Internet content provider (ICP) number for the domain name.
 * You cannot call the **UpdateDomain** operation again by using the same Alibaba Cloud account before the previous request is completed.
 *
 * @param request UpdateDomainRequest
 * @return UpdateDomainResponse
 */
async function updateDomain(request: UpdateDomainRequest): UpdateDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDomainWithOptions(request, runtime);
}

model UpdateDomainStateRequest {
  domain?: string(name='Domain', description='The accelerated domain name whose ICP filing status you want to update.

This parameter is required.', example='www.example.com'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
}

model UpdateDomainStateResponseBody = {
  domain?: string(name='Domain', description='The accelerated domain name.', example='www.example.com'),
  requestId?: string(name='RequestId', description='The request ID.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  state?: string(name='State', description='The ICP filing status of the accelerated domain name. Valid values:

*   **illegal:** The domain name is illegal.
*   **inactive:** The domain name has not completed ICP filing.
*   **active:** The domain name has a valid ICP number.
*   **unknown:** The ICP filing status is unknown.', example='active'),
}

model UpdateDomainStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDomainStateResponseBody(name='body'),
}

/**
 * @summary Updates the ICP filing status of an accelerated domain name.
 *
 * @description You can call this operation to query and update the ICP filing status of an accelerated domain name.
 * The **UpdateDomainState** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation with the same Alibaba Cloud account.
 *
 * @param request UpdateDomainStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDomainStateResponse
 */
async function updateDomainStateWithOptions(request: UpdateDomainStateRequest, runtime: Util.RuntimeOptions): UpdateDomainStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDomainState',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the ICP filing status of an accelerated domain name.
 *
 * @description You can call this operation to query and update the ICP filing status of an accelerated domain name.
 * The **UpdateDomainState** operation holds an exclusive lock on the GA instance. While the operation is in progress, you cannot call the same operation with the same Alibaba Cloud account.
 *
 * @param request UpdateDomainStateRequest
 * @return UpdateDomainStateResponse
 */
async function updateDomainState(request: UpdateDomainStateRequest): UpdateDomainStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDomainStateWithOptions(request, runtime);
}

model UpdateEndpointGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. ClientToken can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** may be different for each API request.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the endpoint group.

The description cannot exceed 256 characters in length and cannot contain `http://` or `https://`.', example='EndpointGroup'),
  endpointConfigurations?: [ 
    {
      enableClientIPPreservation?: boolean(name='EnableClientIPPreservation', description='Specifies whether to reserve client IP addresses. Default value: false. Valid values:

*   **true**: reserves client IP addresses.
*   **false**: does not reserve client IP addresses.', example='false'),
      enableProxyProtocol?: boolean(name='EnableProxyProtocol', description='Specifies whether to preserve client IP addresses by using the ProxyProtocol module. Default value: false. Valid values:

*   **true**: preserves client IP addresses by using the ProxyProtocol module.
*   **false**: does not preserve client IP addresses by using the ProxyProtocol module.', example='false'),
      endpoint?: string(name='Endpoint', description='The IP address or domain name of the endpoint.

This parameter is required.', example='120.XX.XX.21'),
      subAddress?: string(name='SubAddress', description='The private IP address of the ENI.

> - When the Endpoint type is ENI, this parameter can be configured. If not configured, it defaults to the primary private IP address of ENI.', example='172.168.XX.XX'),
      type?: string(name='Type', description='The type of the endpoint. Valid values:

*   **Domain:** a custom domain name.
*   **Ip:** a custom IP address.
*   **PublicIp:** a public IP address provided by Alibaba Cloud.
*   **ECS:** Elastic Compute Service (ECS) instance.
*   **SLB:** Server Load Balancer (SLB) instance.
*   **ALB:** Application Load Balancer (ALB) instance.
*   **OSS:** Object Storage Service (OSS) bucket.
*   **ENI:** Elastic Network interface (ENI).
*   **NLB:** Network Load Balancer (NLB) instance.

> *   If you set this parameter to **ECS** or **SLB** and the service-linked role AliyunServiceRoleForGaVpcEndpoint does not exist, the system automatically creates the service-linked role.
> *   If you set this parameter to **ALB** and the service-linked role AliyunServiceRoleForGaAlb does not exist, the system automatically creates the service-linked role.
> *   If you set this parameter to **OSS** and the service-linked role AliyunServiceRoleForGaOss does not exist, the system automatically creates the service-linked role.

For more information, see [Service-linked roles](https://help.aliyun.com/document_detail/178360.html).

This parameter is required.', example='Ip'),
      weight?: int32(name='Weight', description='The weight of the endpoint.

Valid values: **0** to **255**.

>  If the weight of an endpoint is set to 0, GA stops distributing network traffic to the endpoint. Proceed with caution.

This parameter is required.', example='20'),
    }
  ](name='EndpointConfigurations', description='The information about the endpoints.

You can specify information for up to 20 endpoints.'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1dmlohjjz4kqaun****'),
  endpointGroupRegion?: string(name='EndpointGroupRegion', description='The ID of the region where the endpoint group is created.

This parameter is required.', example='cn-hangzhou'),
  endpointProtocolVersion?: string(name='EndpointProtocolVersion', description='The protocol version that is used by the backend service. Valid values:

*   **HTTP1.1**
*   **HTTP2**

> *   You can set this parameter only when the endpoint request protocol  uses **HTTPS** protocol.'),
  endpointRequestProtocol?: string(name='EndpointRequestProtocol', description='The protocol that is used by the backend service. Valid values:

*   **HTTP**
*   **HTTPS**

> *   You can set this parameter only when the listener that is associated with the endpoint group uses the HTTP or HTTPS protocol.
> *   For an HTTP listener, the backend service protocol must be HTTP.', example='HTTP'),
  healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable the health check feature. Default value: true. Valid values:

*   **true**: enables the health check feature.
*   **false**: disables the health check feature.', example='true'),
  healthCheckIntervalSeconds?: int32(name='HealthCheckIntervalSeconds', description='The interval between two consecutive health checks. Unit: seconds. Valid values: **1** to **50**.', example='3'),
  healthCheckPath?: string(name='HealthCheckPath', description='The path to which health check requests are sent.', example='/healthcheck'),
  healthCheckPort?: int32(name='HealthCheckPort', description='The port that is used for health checks. Valid values: **1** to **65535**.', example='20'),
  healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol over which health check requests are sent. Valid values:

*   **tcp**: TCP
*   **http**: HTTP
*   **https**: HTTPS', example='tcp'),
  name?: string(name='Name', description='The name of the endpoint group.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.', example='group1'),
  portOverrides?: [ 
    {
      endpointPort?: int32(name='EndpointPort', description='The endpoint port that is mapped to the listener port.', example='80'),
      listenerPort?: int32(name='ListenerPort', description='The listener port that is mapped to the endpoint port.

> *   Only HTTP and HTTPS listeners support port mappings.
> *   The listener port in a port mapping must be the one used by the current listener.', example='443'),
    }
  ](name='PortOverrides', description='The mappings between ports.'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
  thresholdCount?: int32(name='ThresholdCount', description='The number of consecutive health check failures that must occur before a healthy endpoint group is considered unhealthy, or the number of consecutive health check successes that must occur before an unhealthy endpoint group is considered healthy.

Valid values: **2** to **10**.', example='3'),
  trafficPercentage?: int32(name='TrafficPercentage', description='The weight of the endpoint group when the listener is associated with multiple endpoint groups.', example='20'),
}

model UpdateEndpointGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateEndpointGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEndpointGroupResponseBody(name='body'),
}

/**
 * @summary Modifies an endpoint group of a basic Global Accelerator (GA) instance.
 *
 * @description *   **UpdateEndpointGroup** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that the configurations of the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the configurations of the endpoint group are modified.
 * *   The **UpdateEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateEndpointGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEndpointGroupResponse
 */
async function updateEndpointGroupWithOptions(request: UpdateEndpointGroupRequest, runtime: Util.RuntimeOptions): UpdateEndpointGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointConfigurations)) {
    query['EndpointConfigurations'] = request.endpointConfigurations;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.endpointGroupRegion)) {
    query['EndpointGroupRegion'] = request.endpointGroupRegion;
  }
  if (!Util.isUnset(request.endpointProtocolVersion)) {
    query['EndpointProtocolVersion'] = request.endpointProtocolVersion;
  }
  if (!Util.isUnset(request.endpointRequestProtocol)) {
    query['EndpointRequestProtocol'] = request.endpointRequestProtocol;
  }
  if (!Util.isUnset(request.healthCheckEnabled)) {
    query['HealthCheckEnabled'] = request.healthCheckEnabled;
  }
  if (!Util.isUnset(request.healthCheckIntervalSeconds)) {
    query['HealthCheckIntervalSeconds'] = request.healthCheckIntervalSeconds;
  }
  if (!Util.isUnset(request.healthCheckPath)) {
    query['HealthCheckPath'] = request.healthCheckPath;
  }
  if (!Util.isUnset(request.healthCheckPort)) {
    query['HealthCheckPort'] = request.healthCheckPort;
  }
  if (!Util.isUnset(request.healthCheckProtocol)) {
    query['HealthCheckProtocol'] = request.healthCheckProtocol;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.portOverrides)) {
    query['PortOverrides'] = request.portOverrides;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.thresholdCount)) {
    query['ThresholdCount'] = request.thresholdCount;
  }
  if (!Util.isUnset(request.trafficPercentage)) {
    query['TrafficPercentage'] = request.trafficPercentage;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEndpointGroup',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an endpoint group of a basic Global Accelerator (GA) instance.
 *
 * @description *   **UpdateEndpointGroup** is an asynchronous operation. After you send a request, the system returns a request ID, but the operation is still being performed in the system background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) operation to query the state of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that the configurations of the endpoint group are being modified. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the configurations of the endpoint group are modified.
 * *   The **UpdateEndpointGroup** operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.
 *
 * @param request UpdateEndpointGroupRequest
 * @return UpdateEndpointGroupResponse
 */
async function updateEndpointGroup(request: UpdateEndpointGroupRequest): UpdateEndpointGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateEndpointGroupWithOptions(request, runtime);
}

model UpdateEndpointGroupAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but make sure that the value is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the endpoint group that you want to modify. The description can be up to 200 characters in length and cannot start with `http://` or `https://`.', example='testEndpointGroup'),
  endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint group.

This parameter is required.', example='epg-bp1ple63864a5hyj5****'),
  name?: string(name='Name', description='The name of the endpoint group that you want to modify.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test'),
  regionId?: string(name='RegionId', description='The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateEndpointGroupAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateEndpointGroupAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEndpointGroupAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the name and description of an endpoint group.
 *
 * @param request UpdateEndpointGroupAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEndpointGroupAttributeResponse
 */
async function updateEndpointGroupAttributeWithOptions(request: UpdateEndpointGroupAttributeRequest, runtime: Util.RuntimeOptions): UpdateEndpointGroupAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endpointGroupId)) {
    query['EndpointGroupId'] = request.endpointGroupId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEndpointGroupAttribute',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the name and description of an endpoint group.
 *
 * @param request UpdateEndpointGroupAttributeRequest
 * @return UpdateEndpointGroupAttributeResponse
 */
async function updateEndpointGroupAttribute(request: UpdateEndpointGroupAttributeRequest): UpdateEndpointGroupAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateEndpointGroupAttributeWithOptions(request, runtime);
}

model UpdateEndpointGroupsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true:** performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  endpointGroupConfigurations?: [ 
    {
      enableClientIPPreservationProxyProtocol?: boolean(name='EnableClientIPPreservationProxyProtocol', description='Specifies whether to use the proxy protocol to preserve client IP addresses. Valid values:

*   **true**
*   **false**', example='false'),
      enableClientIPPreservationToa?: boolean(name='EnableClientIPPreservationToa', description='Specifies whether to use the TCP Option Address (TOA) module to preserve client IP addresses. Valid values:

*   **true**
*   **false**', example='false'),
      endpointConfigurations?: [ 
        {
          endpoint?: string(name='Endpoint', description='The IP address, domain name, or instance ID based on the value of Type.

This parameter is required.', example='47.0.XX.XX'),
          subAddress?: string(name='SubAddress', description='The private IP address of the ENI.

>   If you set the endpoint type to ENI, you can specify this parameter. If you leave this parameter empty, the primary private IP address of the ENI is used.', example='172.168.XX.XX'),
          type?: string(name='Type', description='The type of the endpoint. Valid values:

*   **Domain:** a custom domain name.
*   **Ip:** a custom IP address.
*   **PublicIp:** a public IP address provided by Alibaba Cloud.
*   **ECS:** an Elastic Compute Service (ECS) instance.
*   **SLB:**: a Server Load Balancer (SLB) instance.
*   **ALB:** an Application Load Balancer (ALB) instance.
*   **OSS:** an Object Storage Service (OSS) bucket.
*   **ENI:** an elastic network interface (ENI).
*   **NLB:** a Network Load Balancer (NLB) instance.

> *   If you set this parameter to **ECS** or **SLB** and the AliyunServiceRoleForGaVpcEndpoint service-linked role does not exist, the system automatically creates the role.
>*   If you set this parameter to **ALB** and the AliyunServiceRoleForGaAlb service-linked role does not exist, the system automatically creates the role.
>*   If you set this parameter to **OSS** and the AliyunServiceRoleForGaOss service-linked role does not exist, the system automatically creates the role.
> >For more information, see [Service-linked roles](https://help.aliyun.com/document_detail/178360.html).

This parameter is required.', example='Ip'),
          weight?: long(name='Weight', description='The weight of the endpoint.

Valid values: **0** to **255**.

>  If you set the weight of an endpoint to 0, GA stops distributing traffic to the endpoint. Proceed with caution.

This parameter is required.', example='20'),
        }
      ](name='EndpointConfigurations', description='The configurations of endpoints in the endpoint group.'),
      endpointGroupDescription?: string(name='EndpointGroupDescription', description='The description of the endpoint group.

The description can be up to 256 characters in length and cannot contain `http://` or `https://`.', example='group1'),
      endpointGroupId?: string(name='EndpointGroupId', description='The ID of the endpoint.

This parameter is required.', example='ep-bp1d2utp8qqe2a44t****'),
      endpointGroupName?: string(name='EndpointGroupName', description='The name of the endpoint group.

The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.', example='group1'),
      endpointProtocolVersion?: string(name='EndpointProtocolVersion', description='The protocol version that is used by the backend service. Valid values:

*   **HTTP1.1**
*   **HTTP2**

> *   You can specify this parameter only if the endpoint request protocol uses **HTTPS**.'),
      endpointRequestProtocol?: string(name='EndpointRequestProtocol', description='The protocol that is used by the backend service. Valid values:

*   **HTTP**
*   **HTTPS**

> *   You can specify this parameter only if the listener that is associated with the endpoint group uses HTTP or HTTPS.
> *   The backend service protocol of an HTTP listener must be HTTP.', example='HTTP'),
      healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable the health check feature. Valid values:

*   **true**
*   **false** (default)', example='true'),
      healthCheckIntervalSeconds?: long(name='HealthCheckIntervalSeconds', description='The interval between two consecutive health checks. Unit: seconds. Valid values: **1** to **50**.', example='3'),
      healthCheckPath?: string(name='HealthCheckPath', description='The health check path.', example='/healthcheck'),
      healthCheckPort?: long(name='HealthCheckPort', description='The port that is used for health checks.

Valid values: **1** to **65535**.', example='20'),
      healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol over which health check requests are sent. Valid values:

*   **tcp** or **TCP**
*   **http** or **HTTP**
*   **https** or **HTTPS**', example='tcp'),
      portOverrides?: [ 
        {
          endpointPort?: long(name='EndpointPort', description='The endpoint port.

Valid values: **1** to **65499**.', example='80'),
          listenerPort?: long(name='ListenerPort', description='The listener port.

Valid values: **1** to **65499**.

> *   Only HTTP and HTTPS listeners support port mappings.
>*   The listener port in a port mapping must be the port that is used by the current listener.', example='443'),
        }
      ](name='PortOverrides', description='The port mapping.'),
      thresholdCount?: long(name='ThresholdCount', description='The number of failed consecutive health checks that must occur before a healthy endpoint group is considered unhealthy or the number of successful consecutive health checks that must occur before an unhealthy endpoint group is considered healthy.

Valid values: **2** to **10**.', example='3'),
      trafficPercentage?: long(name='TrafficPercentage', description='The traffic ratio of the endpoint group when the specified listener is associated with multiple endpoint groups.

Valid values: **1** to **100**.', example='20'),
    }
  ](name='EndpointGroupConfigurations', description='The configurations of the endpoint group.

This parameter is required.'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateEndpointGroupsResponseBody = {
  endpointGroupIds?: [ string ](name='EndpointGroupIds', description='The IDs of the endpoint groups.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateEndpointGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEndpointGroupsResponseBody(name='body'),
}

/**
 * @summary Modifies the endpoint groups that are associated with a listener.
 *
 * @description ### Description
 * *   **UpdateEndpointGroups** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) or [ListEndpointGroups](https://help.aliyun.com/document_detail/153261.html) operation to query the status of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that the configuration of the endpoint group is being modified. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the configuration of the endpoint group is modified.
 * *   The **UpdateEndpointGroups** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request UpdateEndpointGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEndpointGroupsResponse
 */
async function updateEndpointGroupsWithOptions(request: UpdateEndpointGroupsRequest, runtime: Util.RuntimeOptions): UpdateEndpointGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.endpointGroupConfigurations)) {
    query['EndpointGroupConfigurations'] = request.endpointGroupConfigurations;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEndpointGroups',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the endpoint groups that are associated with a listener.
 *
 * @description ### Description
 * *   **UpdateEndpointGroups** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeEndpointGroup](https://help.aliyun.com/document_detail/153260.html) or [ListEndpointGroups](https://help.aliyun.com/document_detail/153261.html) operation to query the status of an endpoint group.
 *     *   If the endpoint group is in the **updating** state, it indicates that the configuration of the endpoint group is being modified. In this case, you can perform only query operations.
 *     *   If the endpoint group is in the **active** state, it indicates that the configuration of the endpoint group is modified.
 * *   The **UpdateEndpointGroups** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request UpdateEndpointGroupsRequest
 * @return UpdateEndpointGroupsResponse
 */
async function updateEndpointGroups(request: UpdateEndpointGroupsRequest): UpdateEndpointGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateEndpointGroupsWithOptions(request, runtime);
}

model UpdateForwardingRulesRequest {
  acceleratorId?: string(name='AcceleratorId', description='The GA instance ID.

This parameter is required.', example='ga-bp17frjjh0udz4q****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='02fb3da4****'),
  forwardingRules?: [ 
    {
      forwardingRuleId?: string(name='ForwardingRuleId', description='The forwarding rule ID.

This parameter is required.', example='frule-bp1dii16gu9qdvb34****'),
      forwardingRuleName?: string(name='ForwardingRuleName', description='The forwarding rule name.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test'),
      priority?: int32(name='Priority', description='The priority of the forwarding rule. Valid values: **1** to **10000**. A smaller value specifies a higher priority.

This parameter is required.', example='1000'),
      ruleActions?: [ 
        {
          forwardGroupConfig?: {
            serverGroupTuples?: [ 
              {
                endpointGroupId?: string(name='EndpointGroupId', description='The ID of an endpoint group.

>  We recommend that you use **RuleActionType** and **RuleActionValue** rather than this parameter to configure forwarding actions.

This parameter is required.', example='epg-bp1ieei9664r5nv****'),
              }
            ](name='ServerGroupTuples', description='The configuration of an endpoint group.

>  We recommend that you use **RuleActionType** and **RuleActionValue** rather than this parameter to configure forwarding actions.

This parameter is required.'),
          }(name='ForwardGroupConfig', description='The forwarding configuration.

>  We recommend that you use **RuleActionType** and **RuleActionValue** rather than this parameter to configure forwarding actions.'),
          order?: int32(name='Order', description='The forwarding priority.

>  This parameter does not take effect. Ignore this parameter.

This parameter is required.', example='20'),
          ruleActionType?: string(name='RuleActionType', description='The type of the forwarding action. Valid values:

*   **ForwardGroup**: forwards a request.
*   **Redirect**: redirects a request.
*   **FixResponse**: returns a fixed response.
*   **Rewrite**: rewrites a request.
*   **AddHeader**: adds a header to a request.
*   **RemoveHeader**: deletes the header of a request.

This parameter is required.', example='ForwardGroup'),
          ruleActionValue?: string(name='RuleActionValue', description='The value of the forwarding action.

You must specify different JSON strings based on the value of **RuleActionType**.

A forwarding rule can contain only one forwarding action whose type is **ForwardGroup**, **Redirect**, or **FixResponse**. You must specify a forwarding action whose type is **Rewrite**, **AddHeader**, or **RemoveHeader** before a forwarding action whose type is **ForwardGroup**.

*   If you set **RuleActionType** to **ForwardGroup**, this parameter specifies the information of a virtual endpoint group. You can forward requests to only one virtual endpoint group. Example: `{"type":"endpointgroup", "value":"epg-bp1enpdcrqhl78g6r****"}`.

    *   `type`: Set this parameter to `endpointgroup`.
    *   `value`: Set this parameter to the ID of a virtual endpoint group.

*   If you set **RuleActionType** to **Redirect**, this parameter specifies the redirect configuration. You cannot leave all the following parameters empty or use the default values for all the following parameters for a forwarding action whose type is **Redirect**: `protocol`, `domain`, `port`, `path`, and `query`. Example: `{"protocol":"HTTP", "domain":"www.example.com", "port":"80", "path":"/a","query":"value1", "code":"301" }`.

    *   `protocol`: the protocol of requests after the requests are redirected. Valid values: `${protocol}` (default), `HTTP`, and `HTTPS`.
    *   `domain`: the domain name to which requests are redirected. Default value: `${host}`. You can also enter a domain name. The domain name must be 3 to 128 characters in length, and can contain only letters, digits, and the following special characters: `. - ? = ~ _ - + / ^ * ! $ & | ( ) [ ]`.
    *   `port`: the port to which requests are redirected. Default value: `${port}`. You can enter a port number that ranges from 1 to 63335.
    *   `path`: the path to which requests are redirected. Default value: `${path}`. The path must be 1 to 128 characters in length. To use a regular expression, the path can contain letters, digits, and the following special characters: `. - _ / = ? ~ ^ * $ : ( ) [ ] + |`. The path must start with a tilde (~). If you do not want to use a regular expression, the path can contain letters, digits, and the following special characters: `. - _ / = ? :`. The path must start with a forward slash (/).
    *   `query`: the query string to which requests are redirected. Default value: `${query}`. You can also specify a query string. The query string must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and smaller than 127`. The query string cannot contain uppercase letters, space characters, or the following special characters: `[ ] { } < > # | &`.
    *   `code`: the redirect code. Valid values: `301`, `302`, `303`, `307`, and `308`.

*   If you set **RuleActionType** to **FixResponse**, this parameter specifies a fixed response. Example: `{"code":"200", "type":"text/plain", "content":"dssacav" }`.

    *   `code`: the HTTP response status code. The response status code must be one of the following numeric strings: `2xx`, `4xx`, and `5xx`. The letter `x` is a digit.
    *   `type`: the type of the response content. Valid values: **text/plain**, **text/css**, **text/html**, **application/javascript**, and **application/json**.
    *   `content`: the response content. The response content cannot exceed 1,000 characters in length and does not support Chinese characters.

*   If you set **RuleActionType** to **AddHeader**, this parameter specifies an HTTP header to be added. If a forwarding rule contains a forwarding action whose type is **AddHeader**, you must specify another forwarding action whose type is **ForwardGroup**. Example: `[{"name":"header1","type":"userdefined", "value":"value"}]`.

    *   `name`: the name of the HTTP header. The name must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). The name of the HTTP header specified by **AddHeader** must be unique and cannot be the same as the name of the HTTP header specified by **RemoveHeader**.
    *   `type`: the content type of the HTTP header. Valid values: `user-defined`, `ref`, and `system-defined`.
    *   `value`: the content of the HTTP header. You cannot leave this parameter empty. If you set `type` to `user-defined`, the content must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and smaller than 127`. The content can contain letters, digits, hyphens (-), and underscores (_). The content cannot start or end with a space character. If you set `type` to `ref`, the content must be 1 to 128 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). The content cannot start or end with a space character. If you set `type` to `system-defined`, only `ClientSrcIp` is supported.**

*   If you set **RuleActionType** to **RemoveHeader**, this parameter specifies an HTTP header to be removed. If a forwarding rule contains a forwarding action whose type is **RemoveHeader**, you must specify another forwarding action whose type is **ForwardGroup**. The header must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). Example: `["header1"]`.

*   If you set **RuleActionType** to **Rewrite**, this parameter specifies the rewriting configuration. If a forwarding rule contains a forwarding action whose type is **Rewrite**, you must specify another forwarding action whose type is **ForwardGroup**. Example: `{"domain":"value1", "path":"value2", "query":"value3"}`.

    *   `domain`: the domain name to which requests are redirected. Default value: `${host}`. You can also enter a domain name. The domain name must be 3 to 128 characters in length, and can contain only lowercase letters, digits, and the following special characters: `. - ? = ~ _ - + / ^ * ! $ & | ( ) [ ]`.
    *   `path`: the path to which requests are redirected. Default value: `${path}`. The path must be 1 to 128 characters in length. To use a regular expression, the path can contain letters, digits, and the following special characters: `. - _ / = ? ~ ^ * $ : ( ) [ ] + |`. The path must start with a tilde (~). If you do not want to use a regular expression, the path can contain letters, digits, and the following special characters: `. - _ / = ? :`. The path must start with a forward slash (/).
    *   `query`: the query string to which requests are redirected. Default value: `${query}`. You can also specify a query string. The query string must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and smaller than 127`. The query string cannot contain uppercase letters, space characters, or the following special characters: `[ ] { } < > # | &`.', example='[{"type":"endpointgroup", "value":"epg-bp1enpdcrqhl78g6r****"}]'),
        }
      ](name='RuleActions', description='The configurations of the forwarding actions.

This parameter is required.'),
      ruleConditions?: [ 
        {
          hostConfig?: {
            values?: [ string ](name='Values', description='The domain name configuration.

>  We recommend that you use **RuleConditionType** and **RuleConditionValue** rather than this parameter to configure forwarding conditions.'),
          }(name='HostConfig', description='The domain name configuration.

>  We recommend that you use **RuleConditionType** and **RuleConditionValue** rather than this parameter to configure forwarding conditions.'),
          pathConfig?: {
            values?: [ string ](name='Values', description='The path configuration.

>  We recommend that you use **RuleConditionType** and **RuleConditionValue** rather than this parameter to configure forwarding conditions.'),
          }(name='PathConfig', description='The path configuration.

>  We recommend that you use **RuleConditionType** and **RuleConditionValue** rather than this parameter to configure forwarding conditions.'),
          ruleConditionType?: string(name='RuleConditionType', description='The type of the forwarding condition. Valid values:

*   **Host**: Requests are forwarded based on domain names.
*   **Path**: Requests are forwarded based on paths.
*   **RequestHeader**: Requests are forwarded based on HTTP headers.
*   **Query**: Requests are forwarded based on query strings.
*   **Method**: Requests are forwarded based on HTTP request methods.
*   **Cookie**: Requests are forwarded based on cookies.
*   **SourceIP**: Requests are forwarded based on source IP addresses.

This parameter is required.', example='Host'),
          ruleConditionValue?: string(name='RuleConditionValue', description='The value of the forwarding condition. You must specify different JSON strings based on the value of **RuleConditionType**.

*   If you set **RuleConditionType** to **Host**, this parameter specifies a domain name condition. A forwarding rule can contain only one forwarding condition of the Host type. You can specify multiple domain names in a forwarding condition. The relationship between multiple domain names is OR. The domain name must be 3 to 128 characters in length and can contain letters, digits, hyphens (-), and periods (.). Supported wildcard characters are asterisks (\\\\*) and question marks (?). Example: `["www.example.com", "www.aliyun.com"]`.

*   If **RuleConditionType** is set to **Path**, this parameter specifies a path condition. A forwarding rule can contain multiple forwarding conditions of the Path type. The relationship between multiple path conditions is OR. You can specify multiple paths in a forwarding condition. The relationship between multiple paths is OR. The path must be 1 to 128 characters in length, and must start with a forward slash (/). The path can contain letters, digits, and the following special characters: $ - _ . + / & ~ @ : \\\\". Supported wildcard characters are asterisks (\\\\*) and question marks (?). Example: `["/a", "/b/"]`.

*   If you set **RuleConditionType** to **RequestHeader**, this parameter specifies an HTTP header condition that consists of key-value pairs. The header values in a forwarding condition must be unique. Example: `[{"header1":["value1","value2"]}]`.

    *   Key: The key of an HTTP header must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_).
    *   Value: The value of an HTTP header must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and less than 127`. The value cannot start or end with a space character.

*   If you set **RuleConditionType** to **Query**, this parameter specifies a query string condition that consists of key-value pairs. Example: `[{"query1":["value1"]}, {"query2":["value2"]}]`.

    *   Key: The key of an HTTP header must be 1 to 100 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and less than 127`. The key cannot contain uppercase letters, space characters, or the following special characters: `[ ] { } < > \\\\ ; / ? : @ & = + , $ % | " ^ ~`.
    *   Value: The value of an HTTP header must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and less than 127`. The value cannot contain uppercase letters, space characters, or the following special characters: `[ ] { } < > \\\\ ; / ? : @ & = + , $ % | " ^ ~`.

*   If you set **RuleConditionType** to **Method**, this parameter specifies an HTTP request method condition. Valid values: **HEAD**, **GET**, **POST**, **OPTIONS**, **PUT**, **PATCH**, and **DELETE**. Example: `["GET", "OPTIONS", "POST"]`.

*   If you set **RuleConditionType** to **Cookie**, this parameter specifies a cookie condition that consists of key-value pairs. Example: `[{"cookie1":["value1"]}, {"cookie2":["value2"]}]`.

    *   Key: The key of a cookie must be 1 to 100 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and less than 127`. The key cannot contain uppercase letters, space characters, or the following special characters: `# [ ] { } \\\\ | < > &`.
    *   Value: The value of a cookie must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are `greater than or equal to 32 and less than 127`. The value cannot contain uppercase letters, space characters, or the following special characters: `# [ ] { } \\\\ | < > &`.

*   If you set **RuleConditionType** to **SourceIP**, this parameter specifies a source IP address condition. You can specify IP addresses, such as 1.1.XX.XX/32. You can also specify CIDR blocks, such as 2.2.XX.XX/24. A forwarding rule can contain only one forwarding condition whose type is SourceIP. You can specify multiple source IP addresses in a forwarding condition. The relationship between multiple source IP addresses is OR. Example: `["1.1.XX.XX/32", "2.2.XX.XX/24"]`.', example='["www.example.com", "www.aliyun.com"]'),
        }
      ](name='RuleConditions', description='The forwarding conditions.

This parameter is required.'),
      ruleDirection?: string(name='RuleDirection', description='The direction in which the rule takes effect. You do not need to configure this parameter.

By default, this parameter is set to **request**, which specifies that the rule takes effect on requests.', example='request'),
    }
  ](name='ForwardingRules', description='The configurations of the forwarding rules.

This parameter is required.', example='test'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsr-bp1s0vzbi5bxlx5****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateForwardingRulesResponseBody = {
  forwardingRules?: [ 
    {
      forwardingRuleId?: string(name='ForwardingRuleId', description='The forwarding rule ID.', example='frule-bp1dii16gu9qdvb34****'),
    }
  ](name='ForwardingRules', description='Details about the forwarding rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF'),
}

model UpdateForwardingRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateForwardingRulesResponseBody(name='body'),
}

/**
 * @summary Updates a forwarding rule.
 *
 * @description *   **UpdateForwardingRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListForwardingRules](https://help.aliyun.com/document_detail/205817.html) operation to query the status of a forwarding rule.
 *     *   If the forwarding rule is in the **configuring** state, it indicates that the forwarding rule is being modified. In this case, you can perform only query operations.
 *     *   If the forwarding rule is in the **active** state, it indicates that the forwarding rule is modified.
 * *   The **UpdateForwardingRules** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request UpdateForwardingRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateForwardingRulesResponse
 */
async function updateForwardingRulesWithOptions(request: UpdateForwardingRulesRequest, runtime: Util.RuntimeOptions): UpdateForwardingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceleratorId)) {
    query['AcceleratorId'] = request.acceleratorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forwardingRules)) {
    query['ForwardingRules'] = request.forwardingRules;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateForwardingRules',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a forwarding rule.
 *
 * @description *   **UpdateForwardingRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListForwardingRules](https://help.aliyun.com/document_detail/205817.html) operation to query the status of a forwarding rule.
 *     *   If the forwarding rule is in the **configuring** state, it indicates that the forwarding rule is being modified. In this case, you can perform only query operations.
 *     *   If the forwarding rule is in the **active** state, it indicates that the forwarding rule is modified.
 * *   The **UpdateForwardingRules** operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
 *
 * @param request UpdateForwardingRulesRequest
 * @return UpdateForwardingRulesResponse
 */
async function updateForwardingRules(request: UpdateForwardingRulesRequest): UpdateForwardingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateForwardingRulesWithOptions(request, runtime);
}

model UpdateIpSetRequest {
  bandwidth?: int32(name='Bandwidth', description='The new bandwidth that you want to allocate to the acceleration region. Unit: Mbit/s.

You must allocate at least 2 Mbit/s of bandwidth to each acceleration region.

This parameter is required.', example='3'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='7D2F7E4E-B958-439C-9821-56D6213A31EC'),
  ipSetId?: string(name='IpSetId', description='The ID of the acceleration region that you want to modify.

This parameter is required.', example='ips-bp11r5jb8ogp122xl****'),
  regionId?: string(name='RegionId', description='The ID of the region where the GA instance is deployed. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateIpSetResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='7D2F7E4E-B958-439C-9821-56D6213A31EC'),
}

model UpdateIpSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpSetResponseBody(name='body'),
}

/**
 * @summary Modifies the attributes of an acceleration region in an acceleration area for a Global Accelerator (GA) instance.
 *
 * @description *   **UpdateIpSet** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of an acceleration region.
 *     *   If the acceleration region is in the **updating** state, it indicates that the acceleration region is being modified. In this case, you can continue to perform query operations on the acceleration regions.
 *     *   If the acceleration region is in the **active** state, it indicates that the acceleration region is modified.
 * *   You cannot call the **UpdateIpSet** operation again on the same GA instance before the previous operation is complete.
 *
 * @param request UpdateIpSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpSetResponse
 */
async function updateIpSetWithOptions(request: UpdateIpSetRequest, runtime: Util.RuntimeOptions): UpdateIpSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ipSetId)) {
    query['IpSetId'] = request.ipSetId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpSet',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the attributes of an acceleration region in an acceleration area for a Global Accelerator (GA) instance.
 *
 * @description *   **UpdateIpSet** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of an acceleration region.
 *     *   If the acceleration region is in the **updating** state, it indicates that the acceleration region is being modified. In this case, you can continue to perform query operations on the acceleration regions.
 *     *   If the acceleration region is in the **active** state, it indicates that the acceleration region is modified.
 * *   You cannot call the **UpdateIpSet** operation again on the same GA instance before the previous operation is complete.
 *
 * @param request UpdateIpSetRequest
 * @return UpdateIpSetResponse
 */
async function updateIpSet(request: UpdateIpSetRequest): UpdateIpSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpSetWithOptions(request, runtime);
}

model UpdateIpSetsRequest {
  ipSets?: [ 
    {
      bandwidth?: int32(name='Bandwidth', description='The new bandwidth that you want to allocate to the acceleration regions. Unit: Mbit/s.

You must allocate at least 2 Mbit/s of bandwidth to each acceleration region. You can specify the bandwidth for up to 100 acceleration regions.

This parameter is required.', example='4'),
      ipSetId?: string(name='IpSetId', description='The IDs of the acceleration regions that you want to modify.

You can specify the IDs of up to 100 acceleration regions.

This parameter is required.', example='ips-bp11c9mpphtb1xkds****'),
    }
  ](name='IpSets', description='The acceleration regions.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The region ID of the Global Accelerator (GA) instance. Set the value to **cn-hangzhou**.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateIpSetsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='685662FF-B1CE-4D5C-A4C8-2FF3C2146BFC'),
}

model UpdateIpSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpSetsResponseBody(name='body'),
}

/**
 * @summary Modifies the attributes of acceleration regions in an acceleration area for a Global Accelerator (GA) instance.
 *
 * @description *   **UpdateIpSets** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of the task.
 *     *   If an acceleration region is in the **updating** state, the acceleration region is being modified. In this case, you can perform only query operations.
 *     *   If an acceleration region is in the **active** state, the acceleration region is modified.
 * *   You cannot repeatedly call the **UpdateIpSets** operation for the same GA instance within a specific period of time.
 *
 * @param request UpdateIpSetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpSetsResponse
 */
async function updateIpSetsWithOptions(request: UpdateIpSetsRequest, runtime: Util.RuntimeOptions): UpdateIpSetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipSets)) {
    query['IpSets'] = request.ipSets;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpSets',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the attributes of acceleration regions in an acceleration area for a Global Accelerator (GA) instance.
 *
 * @description *   **UpdateIpSets** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [DescribeIpSet](https://help.aliyun.com/document_detail/153246.html) operation to query the status of the task.
 *     *   If an acceleration region is in the **updating** state, the acceleration region is being modified. In this case, you can perform only query operations.
 *     *   If an acceleration region is in the **active** state, the acceleration region is modified.
 * *   You cannot repeatedly call the **UpdateIpSets** operation for the same GA instance within a specific period of time.
 *
 * @param request UpdateIpSetsRequest
 * @return UpdateIpSetsResponse
 */
async function updateIpSets(request: UpdateIpSetsRequest): UpdateIpSetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpSetsWithOptions(request, runtime);
}

model UpdateListenerRequest {
  backendPorts?: [ 
    {
      fromPort?: int32(name='FromPort', description='The first port in the range of ports that are used by backend servers to receive requests.

> This parameter is required only when you configure an HTTPS or HTTP listener and the listener port is different from the service port of the backend servers. In this case, the first port that is used by the backend servers to receive requests must be the same as the last port.', example='80'),
      toPort?: int32(name='ToPort', description='The last port in the range of ports that are used by backend servers to receive requests.

> This parameter is required only when you configure an HTTPS or HTTP listener and the listener port is different from the service port of the backend servers. In this case, the first port that is used by the backend servers to receive requests must be the same as the last port.', example='80'),
    }
  ](name='BackendPorts', description='The range of ports that are used by backend servers to receive requests.'),
  certificates?: [ 
    {
      id?: string(name='Id', description='The ID of the SSL certificate.

> This parameter is required only when you configure an HTTPS listener.', example='449****-cn-hangzhou'),
    }
  ](name='Certificates', description='The SSL certificate.'),
  clientAffinity?: string(name='ClientAffinity', description='Indicates whether client affinity is enabled for the listener. Valid values:

*   **NONE**: Client affinity is disabled. Requests from the same client may be forwarded to different endpoints.
*   **SOURCE_IP**: Client affinity is enabled. When a client accesses stateful applications, requests from the same client are forwarded to the same endpoint regardless of the source port or protocol.', example='SOURCE_IP'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', description='The description of the listener.

The description can be up to 200 characters in length and cannot start with `http://` or `https://`.', example='Listener'),
  httpVersion?: string(name='HttpVersion', description='The maximum version of the HTTP protocol. Valid values:

*   **http3**
*   **http2**
*   **http1.1**

>  Only HTTPS listeners support this parameter.', example='http2'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period for idle connections. Unit: seconds.

*   TCP: 10-900. Default value: 900. Unit: seconds.
*   UDP: 10-20. Default value: 20. Unit: seconds.
*   HTTP/HTTPS: 1-60. Default value: 15. Unit: seconds.', example='900'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  name?: string(name='Name', description='The name of the listener.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='Listener'),
  portRanges?: [ 
    {
      fromPort?: int32(name='FromPort', description='The first port of the listener port range that is used to receive and forward requests to endpoints.

Valid values: **1** to **65499**. The **FromPort** value must be smaller than or equal to the **ToPort** value.

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).

> You can configure only one listener port for an HTTP or HTTPS listener. In this case, the first port is the same as the last port.

This parameter is required.', example='20'),
      toPort?: int32(name='ToPort', description='The last port of the listener port range that is used to receive and forward requests to endpoints.

Valid values: **1** to **65499**. The **FromPort** value must be smaller than or equal to the **ToPort** value.

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).

> You can configure only one listener port for an HTTP or HTTPS listener. In this case, the first port is the same as the last port.

This parameter is required.', example='21'),
    }
  ](name='PortRanges', description='The listener ports that are used to receive requests and forward the requests to endpoints.

Valid values: **1** to **65499**.

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see [Listener overview](https://help.aliyun.com/document_detail/153216.html).'),
  protocol?: string(name='Protocol', description='The network transmission protocol that is used by the listener. Valid values:

*   **tcp**: TCP
*   **udp**: UDP
*   **http**: HTTP
*   **https**: HTTPS', example='tcp'),
  proxyProtocol?: string(name='ProxyProtocol', description='Specifies whether to reserve client IP addresses. Default value: false. Valid values:

*   **true**: enables client IP preservation. After client IP addresses are reserved, you can view client IP addresses on the endpoints.
*   **false** (default): disables client IP preservation.

> This parameter will be deprecated in the API operations that are used to configure listeners. We recommend that you set this parameter when you call API operations to configure endpoint groups. For more information about the **ProxyProtocol** parameter, see [CreateEndpointGroup](https://help.aliyun.com/document_detail/153259.html) and [UpdateEndpointGroup](https://help.aliyun.com/document_detail/153262.html).', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to **cn-hangzhou**.', example='cn-hangzhou'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period for HTTP or HTTPS requests.

Valid values: 1 to 180. Default value: 60. Unit: seconds.

>  This parameter takes effect only for HTTP or HTTPS listeners. If the backend server does not respond within the timeout period, GA returns an HTTP 504 error code to the client.', example='60'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy. Valid values:

*   **tls_cipher_policy_1_0**

    *   Supported Transport Layer Security (TLS) versions: TLS 1.0, TLS 1.1, and TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA

*   **tls_cipher_policy_1_1**

    *   Supported TLS versions: TLS 1.1 and TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA

*   **tls_cipher_policy_1_2**

    *   Supported TLS version: TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA

*   **tls_cipher_policy_1_2_strict**

    *   Supported TLS version: TLS 1.2
    *   Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA

*   **tls_cipher_policy_1_2_strict_with_1_3**

    *   Supported TLS versions: TLS 1.2 and TLS 1.3
    *   Supported cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-ECDSA-AES128-SHA, ECDHE-ECDSA-AES256-SHA, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA

> This parameter is available only when you create an HTTPS listener.', example='tls_cipher_policy_1_0'),
  XForwardedForConfig?: {
    XForwardedForGaApEnabled?: boolean(name='XForwardedForGaApEnabled', description='Specifies whether to use the `GA-AP` header to retrieve information about acceleration regions. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XForwardedForGaIdEnabled?: boolean(name='XForwardedForGaIdEnabled', description='Specifies whether to use the `GA-ID` header to retrieve the ID of the GA instance. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XForwardedForPortEnabled?: boolean(name='XForwardedForPortEnabled', description='Specifies whether to use the `GA-X-Forward-Port` header to retrieve the listener ports of the GA instance. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Specifies whether to use the `GA-X-Forward-Proto` header to retrieve the listener protocol of the GA instance. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
    XRealIpEnabled?: boolean(name='XRealIpEnabled', description='Specifies whether to use the `X-Real-IP` header to retrieve client IP addresses. Valid values:

*   **true**: yes
*   **false** (default): no

> This parameter is available only when you create an HTTPS or HTTP listener.', example='false'),
  }(name='XForwardedForConfig', description='The `XForward` headers.'),
}

model UpdateListenerResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6FEA0CF3-D3B9-43E5-A304-D217037876A8'),
}

model UpdateListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateListenerResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a listener for a Global Accelerator (GA) instance.
 *
 * @description This operation can be called to modify the configurations such as the protocol and ports of a listener to meet your business requirements.
 * When you call this operation, take note of the following items:
 * *   **UpdateListener** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of a listener.
 *     *   If the listener is in the **updating** state, it indicates that its configurations are being modified. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that its configurations are modified.
 * *   The **UpdateListener** operation cannot be repeatedly called to modify listener configurations for the same GA instance within a specific period of time.
 *
 * @param request UpdateListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateListenerResponse
 */
async function updateListenerWithOptions(request: UpdateListenerRequest, runtime: Util.RuntimeOptions): UpdateListenerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backendPorts)) {
    query['BackendPorts'] = request.backendPorts;
  }
  if (!Util.isUnset(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!Util.isUnset(request.clientAffinity)) {
    query['ClientAffinity'] = request.clientAffinity;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.httpVersion)) {
    query['HttpVersion'] = request.httpVersion;
  }
  if (!Util.isUnset(request.idleTimeout)) {
    query['IdleTimeout'] = request.idleTimeout;
  }
  if (!Util.isUnset(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.portRanges)) {
    query['PortRanges'] = request.portRanges;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.proxyProtocol)) {
    query['ProxyProtocol'] = request.proxyProtocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.requestTimeout)) {
    query['RequestTimeout'] = request.requestTimeout;
  }
  if (!Util.isUnset(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!Util.isUnset(request.XForwardedForConfig)) {
    query['XForwardedForConfig'] = request.XForwardedForConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateListener',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of a listener for a Global Accelerator (GA) instance.
 *
 * @description This operation can be called to modify the configurations such as the protocol and ports of a listener to meet your business requirements.
 * When you call this operation, take note of the following items:
 * *   **UpdateListener** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the [DescribeListener](https://help.aliyun.com/document_detail/153254.html) operation to query the status of a listener.
 *     *   If the listener is in the **updating** state, it indicates that its configurations are being modified. In this case, you can perform only query operations.
 *     *   If the listener is in the **active** state, it indicates that its configurations are modified.
 * *   The **UpdateListener** operation cannot be repeatedly called to modify listener configurations for the same GA instance within a specific period of time.
 *
 * @param request UpdateListenerRequest
 * @return UpdateListenerResponse
 */
async function updateListener(request: UpdateListenerRequest): UpdateListenerResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateListenerWithOptions(request, runtime);
}

model UpdateServiceManagedControlRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the value of **RequestId** as the value of **ClientToken**. The **request ID** may be different for each request.', example='123e4567****'),
  regionId?: string(name='RegionId', description='The region ID of the GA instance. Set the value to cn-hangzhou.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the resource whose control mode you want to change.

This parameter is required.', example='ga-bp149u6o36qt1as9b****'),
  resourceType?: string(name='ResourceType', description='The type of the resource whose control mode you want to change.

Set the value to **Accelerator**, which specifies a standard GA instance.

This parameter is required.', example='Accelerator'),
  serviceManaged?: boolean(name='ServiceManaged', description='The control mode of the resource.

Set the value to **false**, which changes the control mode of the resource from managed mode to unmanaged mode.

>  You can change the control mode only from managed mode to unmanaged mode.', example='false'),
}

model UpdateServiceManagedControlResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='B7770CB9-9745-4FE5-9EDA-D14B01A12A50'),
}

model UpdateServiceManagedControlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceManagedControlResponseBody(name='body'),
}

/**
 * @summary Changes the control mode of a resource from managed mode to unmanaged mode.
 *
 * @description *   This operation is applicable only to **managed** Global Accelerator (GA) instances.
 * *   After you change the control mode of a GA instance from managed mode to unmanaged mode, you cannot change the mode of the instance to managed mode.
 * *   After you change the control mode of a GA instance from managed mode to unmanaged mode, you can obtain all operation permissions on the instance.
 *   <warning>If you change or delete a configuration of a GA instance whose control mode is changed from managed mode to unmanaged mode, the cloud services that depend on the instance may not work as expected. Proceed with caution.
 *
 * @param request UpdateServiceManagedControlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceManagedControlResponse
 */
async function updateServiceManagedControlWithOptions(request: UpdateServiceManagedControlRequest, runtime: Util.RuntimeOptions): UpdateServiceManagedControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.serviceManaged)) {
    query['ServiceManaged'] = request.serviceManaged;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServiceManagedControl',
    version = '2019-11-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the control mode of a resource from managed mode to unmanaged mode.
 *
 * @description *   This operation is applicable only to **managed** Global Accelerator (GA) instances.
 * *   After you change the control mode of a GA instance from managed mode to unmanaged mode, you cannot change the mode of the instance to managed mode.
 * *   After you change the control mode of a GA instance from managed mode to unmanaged mode, you can obtain all operation permissions on the instance.
 *   <warning>If you change or delete a configuration of a GA instance whose control mode is changed from managed mode to unmanaged mode, the cloud services that depend on the instance may not work as expected. Proceed with caution.
 *
 * @param request UpdateServiceManagedControlRequest
 * @return UpdateServiceManagedControlResponse
 */
async function updateServiceManagedControl(request: UpdateServiceManagedControlRequest): UpdateServiceManagedControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateServiceManagedControlWithOptions(request, runtime);
}

